aboutsummaryrefslogtreecommitdiffstats
path: root/source/app/Services/LogService.php
blob: 574d3e52438b7327f74784050ab020d93d667d03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

namespace App\Services;

use App\Enums\LogLevel;
use App\Models\Log;

class LogService
{

    public function setLog(string $actor, $actor_id, string $action, string $targetType, LogLevel $severity = LogLevel::NORMAL): void
    {
        Log::create([
            'actor' => $actor,
            'actor_id' => $actor_id,
            'action' => $action,
            'target_type' => $targetType,
            'severity' => $severity->value,
        ]);
    }
}