2016-06-04 13:42:12 +00:00
|
|
|
<?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.
|
|
|
|
*
|
2016-06-04 14:17:24 +00:00
|
|
|
* @param Request $request
|
2016-06-04 13:42:12 +00:00
|
|
|
*
|
2016-06-04 14:17:24 +00:00
|
|
|
* @return \Symfony\Component\HttpFoundation\BinaryFileResponse
|
2016-06-04 13:42:12 +00:00
|
|
|
*/
|
|
|
|
public function download(Request $request)
|
|
|
|
{
|
|
|
|
return response()->download(Download::from(Song::getFavorites($request->user())));
|
|
|
|
}
|
|
|
|
}
|