Files
nexusphp/app/Models/StaffMessage.php

28 lines
551 B
PHP
Raw Normal View History

2022-06-14 01:07:05 +08:00
<?php
namespace App\Models;
class StaffMessage extends NexusModel
{
protected $table = 'staffmessages';
protected $fillable = [
'sender', 'added', 'subject', 'msg', 'answeredby', 'answered', 'answer'
];
protected $casts = [
'added' => 'datetime',
];
public function send_user()
{
return $this->belongsTo(User::class, 'sender')->withDefault(['id' => 0, 'username' => 'System']);
}
public function answer_user()
{
return $this->belongsTo(User::class, 'answeredby');
}
}