forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActivityLogSubject.php
More file actions
45 lines (37 loc) · 1.14 KB
/
ActivityLogSubject.php
File metadata and controls
45 lines (37 loc) · 1.14 KB
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
<?php
namespace Pterodactyl\Models;
use Illuminate\Database\Eloquent\Relations\Pivot;
/**
* \Pterodactyl\Models\ActivityLogSubject.
*
* @property int $id
* @property int $activity_log_id
* @property int $subject_id
* @property string $subject_type
* @property \Pterodactyl\Models\ActivityLog|null $activityLog
* @property \Illuminate\Database\Eloquent\Model|\Eloquent $subject
*
* @method static \Illuminate\Database\Eloquent\Builder|ActivityLogSubject newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ActivityLogSubject newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|ActivityLogSubject query()
* @mixin \Eloquent
*/
class ActivityLogSubject extends Pivot
{
public $incrementing = true;
public $timestamps = false;
protected $table = 'activity_log_subjects';
protected $guarded = ['id'];
public function activityLog()
{
return $this->belongsTo(ActivityLog::class);
}
public function subject()
{
$morph = $this->morphTo();
if (method_exists($morph, 'withTrashed')) {
return $morph->withTrashed();
}
return $morph;
}
}