koel/app/Observers/AlbumObserver.php

18 lines
265 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;
}
rescue(static fn () => unlink($album->cover_path));
2018-08-29 07:58:46 +00:00
}
}