koel/app/Http/Controllers/API/YouTubeController.php
2021-06-05 12:47:56 +02:00

22 lines
577 B
PHP

<?php
namespace App\Http\Controllers\API;
use App\Http\Requests\API\YouTubeSearchRequest;
use App\Models\Song;
use App\Services\YouTubeService;
class YouTubeController extends Controller
{
private YouTubeService $youTubeService;
public function __construct(YouTubeService $youTubeService)
{
$this->youTubeService = $youTubeService;
}
public function searchVideosRelatedToSong(YouTubeSearchRequest $request, Song $song)
{
return response()->json($this->youTubeService->searchVideosRelatedToSong($song, $request->pageToken));
}
}