updates for admin area
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Message extends Model
|
||||
{
|
||||
protected $fillable = ['from_user_id', 'to_user_id', 'subject', 'body', 'status', 'read_at'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['read_at' => 'datetime'];
|
||||
}
|
||||
|
||||
public function fromUser()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'from_user_id');
|
||||
}
|
||||
|
||||
public function toUser()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'to_user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user