mirror of
https://github.com/koel/koel
synced 2025-01-08 02:38:45 +00:00
17 lines
265 B
PHP
17 lines
265 B
PHP
<?php
|
|
|
|
namespace App\Observers;
|
|
|
|
use App\Models\Album;
|
|
|
|
class AlbumObserver
|
|
{
|
|
public function deleted(Album $album): void
|
|
{
|
|
if (!$album->has_cover) {
|
|
return;
|
|
}
|
|
|
|
rescue(static fn () => unlink($album->cover_path));
|
|
}
|
|
}
|