torrent api + swip constants

This commit is contained in:
xiaomlove
2021-05-15 19:29:44 +08:00
parent 786095ca96
commit 33e99516b6
55 changed files with 1968 additions and 38 deletions

View File

@@ -9,4 +9,19 @@ class Message extends NexusModel
protected $fillable = [
'sender', 'receiver', 'added', 'subject', 'msg', 'unread', 'location', 'saved'
];
protected $casts = [
'added' => 'datetime',
];
public function send_user()
{
return $this->belongsTo(User::class, 'sender')->withDefault(['id' => 0, 'username' => 'System']);
}
public function receive_user()
{
return $this->belongsTo(User::class, 'receiver');
}
}