mirror of
https://github.com/koel/koel
synced 2024-12-11 21:22:28 +00:00
26 lines
580 B
PHP
26 lines
580 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Download;
|
|
|
|
use App\Models\Playlist;
|
|
use Download;
|
|
|
|
class PlaylistController extends Controller
|
|
{
|
|
/**
|
|
* Download all songs in a playlist.
|
|
*
|
|
* @param Playlist $playlist
|
|
*
|
|
* @throws \Illuminate\Auth\Access\AuthorizationException
|
|
* @throws \Exception
|
|
*
|
|
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
|
*/
|
|
public function download(Playlist $playlist)
|
|
{
|
|
$this->authorize('owner', $playlist);
|
|
|
|
return response()->download(Download::from($playlist));
|
|
}
|
|
}
|