mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-10 23:21:06 +03:30
26 lines
632 B
PHP
26 lines
632 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Message extends Model
|
|
{
|
|
use SoftDeletes,HasFactory;
|
|
|
|
public $fillable = ['title', 'text', 'status', 'recipient_user_id', 'sender_user_id'];
|
|
|
|
public function sender_user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'sender_user_id');
|
|
}
|
|
|
|
public function recipient_user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'recipient_user_id');
|
|
}
|
|
}
|