mirror of
https://github.com/koel/koel
synced 2024-11-28 06:50:27 +00:00
19 lines
567 B
PHP
19 lines
567 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\API\UploadAlbumCoverRequest;
|
|
use App\Models\Album;
|
|
use App\Services\MediaMetadataService;
|
|
|
|
class UploadAlbumCoverController extends Controller
|
|
{
|
|
public function __invoke(UploadAlbumCoverRequest $request, Album $album, MediaMetadataService $metadataService)
|
|
{
|
|
$this->authorize('update', $album);
|
|
$metadataService->writeAlbumCover($album, $request->getFileContent());
|
|
|
|
return response()->json(['cover_url' => $album->cover]);
|
|
}
|
|
}
|