mirror of
https://github.com/koel/koel
synced 2024-12-22 10:33:16 +00:00
23 lines
548 B
PHP
23 lines
548 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 protected function supported(): bool;
|
|
|
|
abstract public function storeUploadedFile(UploadedFile $file, User $uploader): Song;
|
|
}
|