koel/app/Http/Controllers/API/YouTubeController.php
2016-08-03 18:42:11 +08:00

23 lines
560 B
PHP

<?php
namespace App\Http\Controllers\API;
use App\Models\Song;
use Illuminate\Http\Request;
use YouTube;
class YouTubeController extends Controller
{
/**
* Search for YouTube videos related to a song (using its title and artist name).
*
* @param Request $request
* @param Song $song
*
* @return \Illuminate\Http\JsonResponse
*/
public function searchVideosRelatedToSong(Request $request, Song $song)
{
return response()->json(YouTube::searchVideosRelatedToSong($song, $request->pageToken));
}
}