koel/app/Http/Controllers/API/Download/PlaylistController.php
2016-06-04 21:29:45 +08:00

25 lines
526 B
PHP

<?php
namespace App\Http\Controllers\API\Download;
use App\Http\Requests\API\Download\Request;
use App\Models\Playlist;
use Download;
class PlaylistController extends Controller
{
/**
* Download all songs in a playlist.
*
* @param Request $request
* @param Playlist $playlist
*
* @return
*/
public function download(Request $request, Playlist $playlist)
{
$this->authorize('owner', $playlist);
return response()->download(Download::from($playlist));
}
}