Initialer Laravel Commit für BetiX
This commit is contained in:
38
app/Models/DirectMessage.php
Normal file
38
app/Models/DirectMessage.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DirectMessage extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'sender_id',
|
||||
'receiver_id',
|
||||
'message',
|
||||
'reply_to_id',
|
||||
'is_read',
|
||||
'is_deleted',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'is_read' => 'boolean',
|
||||
'is_deleted' => 'boolean',
|
||||
];
|
||||
|
||||
public function sender()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'sender_id');
|
||||
}
|
||||
|
||||
public function receiver()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'receiver_id');
|
||||
}
|
||||
|
||||
public function replyTo()
|
||||
{
|
||||
return $this->belongsTo(DirectMessage::class, 'reply_to_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user