feat: chat en tiempo real bidireccional funcionando con Reverb
This commit is contained in:
+16
-4
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user