notificaciones migracion y maquetado y modelo

This commit is contained in:
Felipe
2023-10-23 10:29:15 -05:00
parent ff00f91eed
commit 1d3fac965d
6 changed files with 129 additions and 3 deletions
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class Bell extends Component
{
public $noti = 8;
public $notificaciones = false;
public function render()
{
return view('livewire.bell');
}
}
+33
View File
@@ -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');
}
}