I have configure dingo package in laravel 5.1 but while I try to access
it is showing following error
{"message":"404 Not Found","status_code":404,"debug":{"line":161,"file":"C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\RouteCollection.php","class":"Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException","trace":["#0 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(750): Illuminate\\Routing\\RouteCollection->match(Object(Dingo\\Api\\Http\\Request))","#1 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(659): Illuminate\\Routing\\Router->findRoute(Object(Dingo\\Api\\Http\\Request))","#2 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Routing\\Router.php(635): Illuminate\\Routing\\Router->dispatchToRoute(Object(Dingo\\Api\\Http\\Request))","#3 C:\\wamp64\\www\\second\\vendor\\dingo\\api\\src\\Routing\\Adapter\\Laravel.php(81): Illuminate\\Routing\\Router->dispatch(Object(Dingo\\Api\\Http\\Request))","#4 C:\\wamp64\\www\\second\\vendor\\dingo\\api\\src\\Routing\\Router.php(513): Dingo\\Api\\Routing\\Adapter\\Laravel->dispatch(Object(Dingo\\Api\\Http\\Request), 'v1')","#5 C:\\wamp64\\www\\second\\vendor\\dingo\\api\\src\\Http\\Middleware\\Request.php(126): Dingo\\Api\\Routing\\Router->dispatch(Object(Dingo\\Api\\Http\\Request))","#6 [internal function]: Dingo\\Api\\Http\\Middleware\\Request->Dingo\\Api\\Http\\Middleware\\{closure}(Object(Dingo\\Api\\Http\\Request))","#7 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(139): call_user_func(Object(Closure), Object(Dingo\\Api\\Http\\Request))","#8 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))","#9 [internal function]: Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))","#10 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(124): call_user_func_array(Array, Array)","#11 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\View\\Middleware\\ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))","#12 [internal function]: Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))","#13 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(124): call_user_func_array(Array, Array)","#14 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Session\\Middleware\\StartSession.php(62): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))","#15 [internal function]: Illuminate\\Session\\Middleware\\StartSession->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))","#16 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(124): call_user_func_array(Array, Array)","#17 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))","#18 [internal function]: Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))","#19 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(124): call_user_func_array(Array, Array)","#20 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Cookie\\Middleware\\EncryptCookies.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))","#21 [internal function]: Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))","#22 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(124): call_user_func_array(Array, Array)","#23 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))","#24 [internal function]: Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))","#25 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(124): call_user_func_array(Array, Array)","#26 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))","#27 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(103): call_user_func(Object(Closure), Object(Dingo\\Api\\Http\\Request))","#28 C:\\wamp64\\www\\second\\vendor\\dingo\\api\\src\\Http\\Middleware\\Request.php(127): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))","#29 C:\\wamp64\\www\\second\\vendor\\dingo\\api\\src\\Http\\Middleware\\Request.php(103): Dingo\\Api\\Http\\Middleware\\Request->sendRequestThroughRouter(Object(Dingo\\Api\\Http\\Request))","#30 [internal function]: Dingo\\Api\\Http\\Middleware\\Request->handle(Object(Illuminate\\Http\\Request), Object(Closure))","#31 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(124): call_user_func_array(Array, Array)","#32 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))","#33 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Pipeline\\Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))","#34 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(122): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))","#35 C:\\wamp64\\www\\second\\vendor\\laravel\\framework\\src\\Illuminate\\Foundation\\Http\\Kernel.php(87): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))","#36 C:\\wamp64\\www\\second\\public\\index.php(54): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))","#37 C:\\wamp64\\www\\second\\server.php(21): require_once('C:\\\\wamp64\\\\www\\\\s...')","#38 {main}"]}}
I have following code in routes.php
<?php
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) {
$api->get('test', 'App\Http\Controllers\ApiController@index');
});
Route::get('/', function () {
return view('welcome');
});
While U check for api:route, it shows following following route:
php artisan cache:clear
? – Volost