Agrego archivos iniciales

This commit is contained in:
Laucha1312
2026-06-04 14:47:50 -03:00
commit ed94601e34
76 changed files with 7737 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Notificacion extends Model
{
protected $table = 'notificaciones';
public $timestamps = false;
protected $fillable = [
'tipo_destinatario',
'id_destinatario',
'tipo',
'titulo',
'mensaje',
'url_accion',
'leida',
'enviada_email',
'creada_en',
];
protected $casts = [
'leida' => 'boolean',
'enviada_email' => 'boolean',
'creada_en' => 'datetime',
];
// ── Scopes ──
public function scopeNoLeidas($query)
{
return $query->where('leida', false);
}
public function scopeParaUsuario($query, string $tipo, $id)
{
return $query->where('tipo_destinatario', $tipo)->where('id_destinatario', (string)$id);
}
}