koel/app/Http/Controllers/API/Download/SongController.php
2018-08-29 13:15:23 +07:00

19 lines
422 B
PHP

<?php
namespace App\Http\Controllers\API\Download;
use App\Http\Requests\API\Download\SongRequest;
use App\Models\Song;
class SongController extends Controller
{
/**
* Download a song or multiple songs.
*/
public function show(SongRequest $request)
{
$songs = Song::whereIn('id', $request->songs)->get();
return response()->download($this->downloadService->from($songs));
}
}