mirror of
https://github.com/koel/koel
synced 2024-12-22 10:33:16 +00:00
23 lines
610 B
PHP
23 lines
610 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Download;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Artist;
|
|
use App\Models\User;
|
|
use App\Repositories\SongRepository;
|
|
use App\Services\DownloadService;
|
|
use Illuminate\Contracts\Auth\Authenticatable;
|
|
|
|
class DownloadArtistController extends Controller
|
|
{
|
|
/** @param User $user */
|
|
public function __invoke(
|
|
Artist $artist,
|
|
SongRepository $repository,
|
|
DownloadService $service,
|
|
Authenticatable $user
|
|
) {
|
|
return response()->download($service->getDownloadablePath($repository->getByArtist($artist, $user)));
|
|
}
|
|
}
|