fix : complete Activity log in admin side

This commit is contained in:
2026-08-20 14:51:46 -07:00
parent 6ecb9b2704
commit 88503595d7
14 changed files with 316 additions and 223 deletions
+16
View File
@@ -1,4 +1,7 @@
<?php
use App\Models\ActivityLog;
if (!function_exists('getUserFullName')) {
function getUserFullName(?\App\Models\User $user = null): string
{
@@ -55,4 +58,17 @@ if (!function_exists('getFileUrl')) {
return '';
}
}
if (! function_exists('logActivity')) {
function logActivity(string $logName, int $subjectId, string $event, array $changes = []): void
{
ActivityLog::create([
'log_name' => $logName,
'subject_id' => $subjectId,
'causer_id' => auth('admin')->id(),
'event' => $event,
'changes' => $changes,
]);
}
}
}