notificaciones migracion y maquetado y modelo
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Notificacion extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'notificaciones';
|
||||
|
||||
protected $fillable = [
|
||||
'remitente_id',
|
||||
'destinatario_id',
|
||||
'titulo',
|
||||
'descripcion',
|
||||
'estado',
|
||||
'todos',
|
||||
];
|
||||
|
||||
public function remitente()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'remitente_id');
|
||||
}
|
||||
|
||||
public function destinatario()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'destinatario_id');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user