koel/app/Http/Controllers/API/Download/FavoritesController.php
2016-08-16 23:12:35 +08:00

24 lines
535 B
PHP

<?php
namespace App\Http\Controllers\API\Download;
use App\Http\Requests\API\Download\Request;
use App\Models\Song;
use Download;
class FavoritesController extends Controller
{
/**
* Download all songs in a playlist.
*
* @param Request $request
*
* @throws \Exception
*
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
*/
public function download(Request $request)
{
return response()->download(Download::from(Song::getFavorites($request->user())));
}
}