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

24 lines
597 B
PHP
Raw Normal View History

2024-01-03 17:02:18 +00:00
<?php
namespace App\Http\Controllers\Download;
use App\Http\Controllers\Controller;
use App\Models\Artist;
2024-01-07 12:43:10 +00:00
use App\Models\User;
use App\Repositories\SongRepository;
2024-01-03 17:02:18 +00:00
use App\Services\DownloadService;
2024-01-07 12:43:10 +00:00
use Illuminate\Contracts\Auth\Authenticatable;
2024-01-03 17:02:18 +00:00
class DownloadArtistController extends Controller
{
2024-01-07 12:43:10 +00:00
/** @param User $user */
public function __invoke(
Artist $artist,
SongRepository $repository,
DownloadService $download,
Authenticatable $user
) {
return response()->download($download->from($repository->getByArtist($artist, $user)));
2024-01-03 17:02:18 +00:00
}
}