koel/app/Http/Controllers/Download/PlaylistController.php
2022-07-29 09:04:44 +02:00

21 lines
463 B
PHP

<?php
namespace App\Http\Controllers\Download;
use App\Http\Controllers\Controller;
use App\Models\Playlist;
use App\Services\DownloadService;
class PlaylistController extends Controller
{
public function __construct(private DownloadService $downloadService)
{
}
public function show(Playlist $playlist)
{
$this->authorize('owner', $playlist);
return response()->download($this->downloadService->from($playlist));
}
}