Initial commit

This commit is contained in:
2025-11-20 23:21:05 +08:00
commit 13bc6db529
378 changed files with 54527 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Support;
use App\Models\AuditLog;
use Illuminate\Support\Facades\Auth;
class AuditLogger
{
public static function log(string $action, ?object $auditable = null, array $metadata = []): void
{
AuditLog::create([
'user_id' => optional(Auth::user())->id,
'action' => $action,
'auditable_type' => $auditable ? get_class($auditable) : null,
'auditable_id' => $auditable->id ?? null,
'metadata' => $metadata,
]);
}
}