Files
Skunk-Lounge/app/Models/AuditLog.php

42 lines
798 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class AuditLog extends Model
{
use HasFactory, SoftDeletes;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'user_id',
'action',
'details',
'ip_address',
];
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'details' => 'json',
];
/**
* Get the user that owns the audit log.
*/
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}
}