mirror of
https://github.com/koel/koel
synced 2024-12-27 13:03:06 +00:00
25 lines
703 B
PHP
25 lines
703 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Download;
|
|
|
|
use App\Http\Requests\Download\Request;
|
|
use App\Repositories\InteractionRepository;
|
|
use App\Services\DownloadService;
|
|
|
|
class FavoritesController extends Controller
|
|
{
|
|
private $interactionRepository;
|
|
|
|
public function __construct(DownloadService $downloadService, InteractionRepository $interactionRepository)
|
|
{
|
|
parent::__construct($downloadService);
|
|
$this->interactionRepository = $interactionRepository;
|
|
}
|
|
|
|
public function show(Request $request)
|
|
{
|
|
$songs = $this->interactionRepository->getUserFavorites($request->user());
|
|
|
|
return response()->download($this->downloadService->from($songs));
|
|
}
|
|
}
|