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

19 lines
534 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\User;
2024-01-07 12:43:10 +00:00
use App\Repositories\SongRepository;
2024-01-03 17:02:18 +00:00
use App\Services\DownloadService;
use Illuminate\Contracts\Auth\Authenticatable;
class DownloadFavoritesController extends Controller
{
/** @param User $user */
2024-01-07 12:43:10 +00:00
public function __invoke(DownloadService $download, SongRepository $repository, Authenticatable $user)
2024-01-03 17:02:18 +00:00
{
2024-01-10 23:11:45 +00:00
return response()->download($download->getDownloadablePath($repository->getFavorites($user)));
2024-01-03 17:02:18 +00:00
}
}