mirror of
https://github.com/koel/koel
synced 2024-11-24 13:13:05 +00:00
17 lines
266 B
PHP
17 lines
266 B
PHP
<?php
|
|
|
|
namespace App\Observers;
|
|
|
|
use App\Models\Album;
|
|
|
|
class AlbumObserver
|
|
{
|
|
public function deleted(Album $album): void
|
|
{
|
|
if (!$album->has_cover) {
|
|
return;
|
|
}
|
|
|
|
attempt(static fn () => unlink($album->cover_path));
|
|
}
|
|
}
|