-
Notifications
You must be signed in to change notification settings - Fork 398
/
Copy pathTorrentModerationMessage.php
63 lines (54 loc) · 1.83 KB
/
TorrentModerationMessage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
declare(strict_types=1);
/**
* NOTICE OF LICENSE.
*
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D Community Edition
*
* @author HDVinnie <hdinnovations@protonmail.com>
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
*/
namespace App\Models;
use App\Traits\Auditable;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\TorrentModerationMessage.
*
* @property int $id
* @property int $moderated_by
* @property int $torrent_id
* @property int $status
* @property string|null $message
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
*/
class TorrentModerationMessage extends Model
{
use Auditable;
/** @use HasFactory<\Database\Factories\TorrentModerationMessageFactory> */
use HasFactory;
protected $guarded = [];
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<Torrent, $this>
*/
public function torrent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Torrent::class);
}
/**
* Belongs To A Moderator.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo<User, $this>
*/
public function moderator(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(User::class, 'moderated_by')->withDefault([
'username' => 'System',
'id' => User::SYSTEM_USER_ID,
]);
}
}