40 lines
930 B
PHP
40 lines
930 B
PHP
<?php
|
|
|
|
namespace IriksIT\Manager\Models;
|
|
|
|
use Illuminate\Support\Carbon;
|
|
|
|
/**
|
|
* One line of the audit log: a login, a failed login, or something an account did in the manager.
|
|
* Written by IriksIT\Manager\Modules\Audit\AuditTrail only.
|
|
*
|
|
* @property array<string, mixed>|null $details
|
|
* @property Carbon $created_at
|
|
*/
|
|
class AuditLog extends Model
|
|
{
|
|
public const LOGIN = 'login';
|
|
|
|
public const LOGIN_FAILED = 'login_failed';
|
|
|
|
public const LOGOUT = 'logout';
|
|
|
|
/** Something that was done in the manager. */
|
|
public const ACTION = 'action';
|
|
|
|
/** A page of the manager that was opened. */
|
|
public const VIEWED = 'viewed';
|
|
|
|
/** Something the account was not allowed to do. */
|
|
public const REFUSED = 'refused';
|
|
|
|
public const BAN = 'ban';
|
|
|
|
public $timestamps = false;
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['details' => 'array', 'created_at' => 'datetime'];
|
|
}
|
|
}
|