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