33 lines
593 B
PHP
33 lines
593 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Message extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'conversation_id',
|
|
'sender_type',
|
|
'sender_id',
|
|
'text',
|
|
'attachment_path',
|
|
'attachment_type',
|
|
'is_read',
|
|
'read_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_read' => 'boolean',
|
|
'read_at' => 'datetime',
|
|
];
|
|
|
|
public function conversation()
|
|
{
|
|
return $this->belongsTo(Conversation::class);
|
|
}
|
|
}
|