Files
firefly-iii/app/Models/AuditLogEntry.php

72 lines
2.1 KiB
PHP
Raw Normal View History

2022-10-02 05:37:38 +02:00
<?php
2022-10-16 19:29:53 +02:00
2022-10-02 05:37:38 +02:00
/*
* AuditLogEntry.php
* Copyright (c) 2022 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2022-10-16 19:29:53 +02:00
declare(strict_types=1);
2022-10-02 05:37:38 +02:00
namespace FireflyIII\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class AuditLogEntry
2022-12-11 10:32:25 +01:00
*
* @property-read Model|\Eloquent $auditable
* @property-read Model|\Eloquent $changer
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry newQuery()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry onlyTrashed()
* @method static \Illuminate\Database\Eloquent\Builder|AuditLogEntry query()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry withTrashed()
* @method static \Illuminate\Database\Query\Builder|AuditLogEntry withoutTrashed()
* @mixin \Eloquent
2022-10-02 05:37:38 +02:00
*/
class AuditLogEntry extends Model
{
use SoftDeletes;
protected $casts = [
2022-10-02 14:37:50 +02:00
'before' => 'array',
'after' => 'array',
2022-10-02 05:37:38 +02:00
'created_at' => 'datetime',
'updated_at' => 'datetime',
'deleted_at' => 'datetime',
];
/**
* @codeCoverageIgnore
*/
public function auditable(): MorphTo
{
return $this->morphTo();
}
/**
* @codeCoverageIgnore
*/
public function changer(): MorphTo
{
return $this->morphTo();
}
}