初始化项目
This commit is contained in:
39
app/Models/System/Log.php
Normal file
39
app/Models/System/Log.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\System;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Log extends Model
|
||||
{
|
||||
protected $table = 'system_logs';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'username',
|
||||
'module',
|
||||
'action',
|
||||
'method',
|
||||
'url',
|
||||
'ip',
|
||||
'user_agent',
|
||||
'params',
|
||||
'result',
|
||||
'status_code',
|
||||
'status',
|
||||
'error_message',
|
||||
'execution_time',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'params' => 'array',
|
||||
'execution_time' => 'integer',
|
||||
'status_code' => 'integer',
|
||||
];
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\App\Models\Auth\User::class, 'user_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user