2024-01-03 17:02:18 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Download;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use App\Models\Album;
|
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 DownloadAlbumController extends Controller
|
|
|
|
{
|
2024-01-07 12:43:10 +00:00
|
|
|
/** @param User $user */
|
2024-01-10 23:11:45 +00:00
|
|
|
public function __invoke(
|
|
|
|
Album $album,
|
|
|
|
SongRepository $repository,
|
|
|
|
DownloadService $service,
|
|
|
|
Authenticatable $user
|
|
|
|
) {
|
|
|
|
return response()->download($service->getDownloadablePath($repository->getByAlbum($album, $user)));
|
2024-01-03 17:02:18 +00:00
|
|
|
}
|
|
|
|
}
|