You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
607 B

<?php
namespace App\Class;
use App\Models\UserLog;
use Illuminate\Support\Str;
class LogWriter
{
public static function writeLog($data,$guard = null)
{
$log = new UserLog();
$log->user_id = auth($guard)->user()->id;
$log->user_name = auth($guard)->user()->name;
$log->action = $data['action'];
$log->action_detail = $data['action_detail'];
$log->ip = $data['ip'];
$log->remark = $data['remark'] ?? null;
$log->carnumber = $data['carnumber'] ?? null;
$log->location = $data['location'] ?? null;
$log->save();
}
}