PM_Console/backend/app/Services/ActivityLogService.php

23 خطوط
609 B
PHP

<?php
namespace App\Services;
use App\Models\ActivityLog;
class ActivityLogService
{
public function log($userId, $action, $description, $subjectType = null, $subjectId = null, $projectId = null, $taskId = null, $properties = [])
{
return ActivityLog::create([
'user_id' => $userId,
'action' => $action,
'description' => $description,
'subject_type' => $subjectType,
'subject_id' => $subjectId,
'project_id' => $projectId,
'task_id' => $taskId,
'properties' => $properties,
]);
}
}