2016-07-14 08:47:50 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
|
2017-12-09 18:34:27 +00:00
|
|
|
use App\Http\Requests\API\YouTubeSearchRequest;
|
2016-07-14 08:47:50 +00:00
|
|
|
use App\Models\Song;
|
2018-08-19 11:08:16 +00:00
|
|
|
use App\Services\YouTubeService;
|
2016-07-14 08:47:50 +00:00
|
|
|
|
|
|
|
class YouTubeController extends Controller
|
|
|
|
{
|
2021-06-05 10:47:56 +00:00
|
|
|
private YouTubeService $youTubeService;
|
2018-08-19 11:08:16 +00:00
|
|
|
|
|
|
|
public function __construct(YouTubeService $youTubeService)
|
|
|
|
{
|
|
|
|
$this->youTubeService = $youTubeService;
|
|
|
|
}
|
|
|
|
|
2017-12-09 18:34:27 +00:00
|
|
|
public function searchVideosRelatedToSong(YouTubeSearchRequest $request, Song $song)
|
2016-07-14 08:47:50 +00:00
|
|
|
{
|
2018-08-19 11:08:16 +00:00
|
|
|
return response()->json($this->youTubeService->searchVideosRelatedToSong($song, $request->pageToken));
|
2016-07-14 08:47:50 +00:00
|
|
|
}
|
|
|
|
}
|