2021-01-17 10:49:36 -08:00
|
|
|
<?php
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2021-01-17 10:49:36 -08:00
|
|
|
namespace Pterodactyl\Models;
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
use Illuminate\Database\Eloquent\Attributes\Guarded;
|
2022-10-14 10:59:20 -06:00
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
2021-01-17 10:49:36 -08:00
|
|
|
|
|
|
|
|
/**
|
2026-10-05 18:10:18 -04:00
|
|
|
* @deprecated - this class will be dropped in a future version, use the activity log
|
2021-01-17 10:49:36 -08:00
|
|
|
*/
|
2026-10-05 18:10:18 -04:00
|
|
|
#[Guarded([
|
|
|
|
|
'id',
|
|
|
|
|
'created_at',
|
|
|
|
|
])]
|
2021-01-17 10:49:36 -08:00
|
|
|
class AuditLog extends Model
|
|
|
|
|
{
|
2021-01-25 19:20:51 -08:00
|
|
|
public const UPDATED_AT = null;
|
2021-01-17 10:49:36 -08:00
|
|
|
|
2025-12-20 15:55:13 -08:00
|
|
|
/**
|
2026-10-05 18:10:18 -04:00
|
|
|
* @return array<string, string>
|
2025-12-20 15:55:13 -08:00
|
|
|
*/
|
2026-10-05 18:10:18 -04:00
|
|
|
protected function casts(): array
|
2021-01-17 10:49:36 -08:00
|
|
|
{
|
2026-10-05 18:10:18 -04:00
|
|
|
return [
|
|
|
|
|
'is_system' => 'bool',
|
|
|
|
|
'device' => 'array',
|
|
|
|
|
'metadata' => 'array',
|
|
|
|
|
];
|
2021-01-17 10:49:36 -08:00
|
|
|
}
|
|
|
|
|
|
2025-12-20 15:55:13 -08:00
|
|
|
/**
|
2026-10-05 18:10:18 -04:00
|
|
|
* @return BelongsTo<User, $this>
|
2025-12-20 15:55:13 -08:00
|
|
|
*/
|
2026-10-05 18:10:18 -04:00
|
|
|
public function user(): BelongsTo
|
2021-01-17 10:49:36 -08:00
|
|
|
{
|
2026-10-05 18:10:18 -04:00
|
|
|
return $this->belongsTo(User::class);
|
2021-01-17 10:49:36 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2026-10-05 18:10:18 -04:00
|
|
|
* @return BelongsTo<Server, $this>
|
2021-01-17 10:49:36 -08:00
|
|
|
*/
|
2026-10-05 18:10:18 -04:00
|
|
|
public function server(): BelongsTo
|
2021-01-17 10:49:36 -08:00
|
|
|
{
|
2026-10-05 18:10:18 -04:00
|
|
|
return $this->belongsTo(Server::class);
|
2021-01-17 10:49:36 -08:00
|
|
|
}
|
|
|
|
|
}
|