koel/app/Http/Controllers/API/Download/SongController.php

20 lines
422 B
PHP
Raw Normal View History

2016-06-02 17:53:26 +00:00
<?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.
*/
2018-08-18 11:51:52 +00:00
public function show(SongRequest $request)
2016-06-02 17:53:26 +00:00
{
$songs = Song::whereIn('id', $request->songs)->get();
2018-08-18 11:51:52 +00:00
return response()->download($this->downloadService->from($songs));
2016-06-02 17:53:26 +00:00
}
}