mirror of
https://github.com/koel/koel
synced 2024-12-26 20:43:05 +00:00
22 lines
575 B
PHP
22 lines
575 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Download;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\Download\SongRequest;
|
|
use App\Repositories\SongRepository;
|
|
use App\Services\DownloadService;
|
|
|
|
class SongController extends Controller
|
|
{
|
|
public function __construct(private DownloadService $downloadService, private SongRepository $songRepository)
|
|
{
|
|
}
|
|
|
|
public function show(SongRequest $request)
|
|
{
|
|
$songs = $this->songRepository->getByIds($request->songs);
|
|
|
|
return response()->download($this->downloadService->from($songs));
|
|
}
|
|
}
|