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.
37 lines
792 B
37 lines
792 B
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class OperationLog extends Model
|
|
{
|
|
protected $fillable = [
|
|
'admin_user_id',
|
|
'operator_name',
|
|
'operated_at',
|
|
'http_method',
|
|
'api_path',
|
|
'action_label',
|
|
'ip',
|
|
'user_agent',
|
|
'request_summary',
|
|
'response_code',
|
|
'duration_ms',
|
|
];
|
|
|
|
protected $casts = [
|
|
'admin_user_id' => 'integer',
|
|
'operated_at' => 'datetime',
|
|
'request_summary' => 'array',
|
|
'response_code' => 'integer',
|
|
'duration_ms' => 'integer',
|
|
];
|
|
|
|
public function adminUser(): BelongsTo
|
|
{
|
|
return $this->belongsTo(AdminUser::class, 'admin_user_id');
|
|
}
|
|
}
|