This commit is contained in:
Laucha1312
2026-06-04 15:00:21 -03:00
parent ed94601e34
commit 47408d49fc
76 changed files with 0 additions and 7737 deletions
-40
View File
@@ -1,40 +0,0 @@
<?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);
}
}