31 lines
548 B
PHP
31 lines
548 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ChatMessage extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'chat_conversation_id',
|
|
'sender',
|
|
'body',
|
|
'is_read',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_read' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function conversation()
|
|
{
|
|
return $this->belongsTo(ChatConversation::class, 'chat_conversation_id');
|
|
}
|
|
}
|