|
8 | 8 | use Pterodactyl\Events\ActivityLogged; |
9 | 9 | use Illuminate\Database\Eloquent\Builder; |
10 | 10 | use Illuminate\Database\Eloquent\MassPrunable; |
| 11 | +use Illuminate\Database\Eloquent\Relations\HasOne; |
11 | 12 | use Illuminate\Database\Eloquent\Relations\MorphTo; |
12 | 13 | use Illuminate\Database\Eloquent\Model as IlluminateModel; |
13 | 14 |
|
|
21 | 22 | * @property string|null $description |
22 | 23 | * @property string|null $actor_type |
23 | 24 | * @property int|null $actor_id |
| 25 | + * @property int|null $api_key_id |
24 | 26 | * @property \Illuminate\Support\Collection|null $properties |
25 | 27 | * @property \Carbon\Carbon $timestamp |
26 | 28 | * @property IlluminateModel|\Eloquent $actor |
27 | 29 | * @property \Illuminate\Database\Eloquent\Collection|\Pterodactyl\Models\ActivityLogSubject[] $subjects |
28 | 30 | * @property int|null $subjects_count |
| 31 | + * @property \Pterodactyl\Models\ApiKey|null $apiKey |
29 | 32 | * |
30 | 33 | * @method static Builder|ActivityLog forActor(\Illuminate\Database\Eloquent\Model $actor) |
31 | 34 | * @method static Builder|ActivityLog forEvent(string $action) |
|
34 | 37 | * @method static Builder|ActivityLog query() |
35 | 38 | * @method static Builder|ActivityLog whereActorId($value) |
36 | 39 | * @method static Builder|ActivityLog whereActorType($value) |
| 40 | + * @method static Builder|ActivityLog whereApiKeyId($value) |
37 | 41 | * @method static Builder|ActivityLog whereBatch($value) |
38 | 42 | * @method static Builder|ActivityLog whereDescription($value) |
39 | 43 | * @method static Builder|ActivityLog whereEvent($value) |
@@ -86,6 +90,11 @@ public function subjects() |
86 | 90 | return $this->hasMany(ActivityLogSubject::class); |
87 | 91 | } |
88 | 92 |
|
| 93 | + public function apiKey(): HasOne |
| 94 | + { |
| 95 | + return $this->hasOne(ApiKey::class, 'id', 'api_key_id'); |
| 96 | + } |
| 97 | + |
89 | 98 | public function scopeForEvent(Builder $builder, string $action): Builder |
90 | 99 | { |
91 | 100 | return $builder->where('event', $action); |
|
0 commit comments