koel/app/Http/Controllers/Download/DownloadArtistController.php
2024-07-06 17:44:40 +02:00

23 lines
597 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 $download,
Authenticatable $user
) {
return response()->download($download->from($repository->getByArtist($artist, $user)));
}
}