2024-02-05 13:27:17 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services\SongStorage;
|
|
|
|
|
|
|
|
use App\Exceptions\MethodNotImplementedException;
|
|
|
|
use App\Models\Song;
|
|
|
|
use App\Models\User;
|
2024-02-05 21:17:41 +00:00
|
|
|
use App\Values\SongStorageTypes;
|
2024-02-05 13:27:17 +00:00
|
|
|
use Illuminate\Http\UploadedFile;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The legacy storage implementation for Lambda and S3, to provide backward compatibility.
|
|
|
|
* In this implementation, the songs are supposed to be uploaded to S3 directly.
|
|
|
|
*/
|
2024-02-05 21:17:41 +00:00
|
|
|
final class S3LambdaStorage extends S3CompatibleStorage
|
2024-02-05 13:27:17 +00:00
|
|
|
{
|
|
|
|
public function storeUploadedFile(UploadedFile $file, User $uploader): Song
|
|
|
|
{
|
|
|
|
throw new MethodNotImplementedException('Lambda storage does not support uploading.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function supported(): bool
|
|
|
|
{
|
2024-02-05 21:17:41 +00:00
|
|
|
return SongStorageTypes::supported(SongStorageTypes::S3_LAMBDA);
|
2024-02-05 13:27:17 +00:00
|
|
|
}
|
|
|
|
}
|