migrant-web/app/Models/Message.php
2026-06-02 11:04:43 +05:30

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);
}
}