2
0
Fork 0
mirror of https://github.com/koel/koel synced 2025-01-07 02:08:46 +00:00
koel/app/Services/SongStorage/SongStorage.php
2024-07-06 17:44:46 +02:00

25 lines
626 B
PHP

<?php
namespace App\Services\SongStorage;
use App\Exceptions\KoelPlusRequiredException;
use App\Models\Song;
use App\Models\User;
use Illuminate\Http\UploadedFile;
abstract class SongStorage
{
public function __construct()
{
throw_unless(
$this->supported(),
new KoelPlusRequiredException('The storage driver is only supported in Koel Plus.')
);
}
abstract public function storeUploadedFile(UploadedFile $file, User $uploader): Song;
abstract public function delete(Song $song, bool $backup = false): void;
abstract protected function supported(): bool;
}