owen-it /
laravel-auditing
| 1 | <?php |
||
| 2 | |||
| 3 | namespace OwenIt\Auditing\Models; |
||
| 4 | |||
| 5 | use Illuminate\Database\Eloquent\Model; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * @property string $tags |
||
| 9 | * @property string $event |
||
| 10 | * @property array<string,mixed> $new_values |
||
| 11 | * @property array<string,mixed> $old_values |
||
| 12 | * @property mixed $user |
||
| 13 | * @property mixed $auditable. |
||
| 14 | */ |
||
| 15 | class Audit extends Model implements \OwenIt\Auditing\Contracts\Audit |
||
| 16 | { |
||
| 17 | use \OwenIt\Auditing\Audit; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 18 | |||
| 19 | /** |
||
| 20 | * {@inheritdoc} |
||
| 21 | */ |
||
| 22 | protected $guarded = []; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Is globally auditing disabled? |
||
| 26 | * |
||
| 27 | * @var bool |
||
| 28 | */ |
||
| 29 | public static $auditingGloballyDisabled = false; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | protected $casts = [ |
||
| 35 | 'old_values' => 'json', |
||
| 36 | 'new_values' => 'json', |
||
| 37 | // Note: Please do not add 'auditable_id' in here, as it will break non-integer PK models |
||
| 38 | ]; |
||
| 39 | |||
| 40 | public function getSerializedDate(\DateTimeInterface $date): string |
||
| 41 | { |
||
| 42 | return $this->serializeDate($date); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |