koel/app/Observers/AlbumObserver.php

18 lines
266 B
PHP
Raw Normal View History

2018-08-29 07:58:46 +00:00
<?php
namespace App\Observers;
use App\Models\Album;
class AlbumObserver
{
public function deleted(Album $album): void
{
if (!$album->has_cover) {
return;
}
2022-08-08 16:00:59 +00:00
attempt(static fn () => unlink($album->cover_path));
2018-08-29 07:58:46 +00:00
}
}