koel/app/Http/Controllers/API/Download/FavoritesController.php
2016-06-04 21:42:12 +08:00

23 lines
483 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
* @param Playlist $playlist
*
* @return
*/
public function download(Request $request)
{
return response()->download(Download::from(Song::getFavorites($request->user())));
}
}