Add all files

This commit is contained in:
root
2025-11-30 11:57:22 +01:00
parent 2ee51cac4f
commit 044271db3d
1476 changed files with 142544 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace Paymenter\Extensions\Others\ComplianceTools\Services;
use App\Models\User;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Facades\Auth;
use Paymenter\Extensions\Others\ComplianceTools\Models\AuditLog;
class AuditLogService
{
public static function record(
string $category,
string $event,
array $context = [],
?User $subject = null,
Authenticatable|User|null $actor = null
): AuditLog {
$actor ??= Auth::user();
return AuditLog::create([
'category' => $category,
'event' => $event,
'subject_user_id' => $subject?->getKey(),
'actor_type' => $actor?->getMorphClass(),
'actor_id' => $actor?->getAuthIdentifier(),
'ip_address' => request()->ip(),
'context' => $context,
]);
}
}