File transfer

This commit is contained in:
2026-06-11 20:33:44 -05:00
parent 2cb1d58264
commit b362357bcb
58 changed files with 5096 additions and 4 deletions

View File

@@ -0,0 +1,52 @@
<?php
/**
* @author Ball Studios <https://git.balls.studio>
* @license MIT
*/
namespace Pterodactyl\Addons\AdvancedAdmin\Models;
use Illuminate\Database\Eloquent\Model;
class RoleAuditLog extends Model
{
protected $table = 'addon_role_audit_log';
public $timestamps = false;
protected $fillable = [
'actor_id',
'action',
'target_type',
'target_id',
'payload',
'ip_address',
];
protected $casts = [
'payload' => 'array',
'created_at' => 'datetime',
];
/**
* Write a structured audit entry.
*/
public static function record(
?int $actorId,
string $action,
string $targetType = '',
?int $targetId = null,
array $payload = [],
string $ip = ''
): void {
static::create([
'actor_id' => $actorId,
'action' => $action,
'target_type' => $targetType,
'target_id' => $targetId,
'payload' => $payload,
'ip_address' => $ip ?: request()->ip(),
'created_at' => now(),
]);
}
}