fix : complete Activity log in admin side
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user