mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 06:13:45 +02:00
Test that a deleted backup makes an audit log entry
This commit is contained in:
@@ -21,6 +21,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
* @property \Carbon\CarbonImmutable $updated_at
|
||||
* @property \Carbon\CarbonImmutable|null $deleted_at
|
||||
* @property \Pterodactyl\Models\Server $server
|
||||
* @property \Pterodactyl\Models\AuditLog[] $audits
|
||||
*/
|
||||
class Backup extends Model
|
||||
{
|
||||
@@ -98,4 +99,14 @@ class Backup extends Model
|
||||
{
|
||||
return $this->belongsTo(Server::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function audits()
|
||||
{
|
||||
return $this->hasMany(AuditLog::class, 'metadata->backup_uuid', 'uuid')
|
||||
->where('action', 'LIKE', 'server:backup.%');
|
||||
// ->where('metadata->backup_uuid', $this->uuid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user