mirror of
https://github.com/koel/koel
synced 2024-12-22 02:23:14 +00:00
24 lines
547 B
PHP
24 lines
547 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Download;
|
|
|
|
use App\Http\Requests\API\Download\Request;
|
|
use App\Models\Song;
|
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
|
|
|
class FavoritesController extends Controller
|
|
{
|
|
/**
|
|
* Download all songs in a playlist.
|
|
*
|
|
* @param Request $request
|
|
*
|
|
* @return BinaryFileResponse
|
|
*/
|
|
public function show(Request $request)
|
|
{
|
|
$songs = Song::getFavorites($request->user());
|
|
|
|
return response()->download($this->downloadService->from($songs));
|
|
}
|
|
}
|