});
// Route::get('/soundcloud/{username}', function ($username) {
//     $soundcloud = new SoundCloud([
//     	'clientID' => '8b4d6faddcc921664343f7420f4def20'
//     ]);
//
//     $tracks = $soundcloud->tracks("https://soundcloud.com/$username");
//
//     return view('soundcloud', [
//         'tracks' => $tracks,
//         'username' => $username
//     ]);
// });
// return videos of the specific artist
Route::get('/itunes/{artist}', function ($artist) {
    $itunes = new iTunes();
    $videos = $itunes->getArtist("https://itunes.apple.com/search?term={$artist}&entity=musicVideo&limit=10");
    return view('itunes', ["artists" => $videos->results]);
});
Route::get('/', function () {
    return view('welcome');
});
Route::group(['middleware' => 'web'], function () {
    Route::get('/dvds/search', 'DvdController@search');
    Route::get('/dvds', 'DvdController@results');
    Route::get('genres/{genreId}/dvds', 'DvdController@genreResults');
    Route::get('/dvds/create', 'DvdController@create');
    Route::post('/dvds', 'DvdController@store');
    Route::get('/dvds/{id}', 'DvdController@details');
});
/*
| and give it the controller to call when that URI is requested.
|
*/
use App\Services\API\iTunes;
Route::group(['prefix' => 'api/v1', 'namespace' => 'API'], function () {
    // GET api/v1/genres
    Route::get('genres', 'DvdController@genres');
    Route::get('genres/{id}', 'DvdController@genreId');
    // GET api/v1/dvds
    Route::get('dvds', 'DvdController@results');
    Route::get('dvds/{id}', 'DvdController@dvdId');
    // POST api/v1/dvds
    Route::post('dvds', 'DvdController@store');
});
Route::get('/itunes/{artist}', function ($artist) {
    $itunes = new iTunes();
    $artistResults = $itunes->getArtist("https://itunes.apple.com/search?term={$artist}");
    //    var_dump($artistResults);
    //
    //
    return view('itunes', ["artists" => $artistResults->results]);
});
Route::group(['middleware' => ['web']], function () {
    Route::get('/search', 'MusicController@search');
    Route::get('/results', 'MusicController@results');
    Route::get('/artists/new', 'ArtistController@create');
    Route::post('/artists', 'ArtistController@store');
    Route::get('/dvds/search', 'DvdController@search');
    Route::get('/dvds', 'DvdController@results');
    Route::post('/dvds', 'DvdController@store');
    Route::get('/dvds/{id}', 'DvdController@info');