mirror of
https://github.com/openclassify/openclassify.git
synced 2026-04-14 11:12:09 -05:00
33 lines
578 B
PHP
33 lines
578 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ConversationMessage extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'conversation_id',
|
|
'sender_id',
|
|
'body',
|
|
'read_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'read_at' => 'datetime',
|
|
];
|
|
|
|
public function conversation()
|
|
{
|
|
return $this->belongsTo(Conversation::class);
|
|
}
|
|
|
|
public function sender()
|
|
{
|
|
return $this->belongsTo(User::class, 'sender_id');
|
|
}
|
|
}
|