koel/app/Http/Controllers/Download/PlaylistController.php

21 lines
461 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('own', $playlist);
return response()->download($this->downloadService->from($playlist));
}
}