feat: chat en tiempo real bidireccional funcionando con Reverb

This commit is contained in:
2026-04-26 02:15:21 -06:00
parent 2de99b8cd2
commit ab967e8ba4
15 changed files with 352 additions and 392 deletions
+16 -4
View File
@@ -7,13 +7,25 @@ use Illuminate\Database\Eloquent\Model;
class Message extends Model
{
protected $fillable = [
'conversation_id',
'user_id',
'message'
'receiver_id',
'body',
'attachment',
'attachment_type',
'read_at',
];
public function user()
protected $casts = [
'read_at' => 'datetime',
];
public function sender()
{
return $this->belongsTo(User::class);
return $this->belongsTo(User::class, 'user_id');
}
public function receiver()
{
return $this->belongsTo(User::class, 'receiver_id');
}
}