I got the error immediately I added the route group to the following group
<?php
$api = app('Dingo\Api\Routing\Router');
$api->version('v1', function ($api) {
$api->post('auth/login', 'App\Api\V1\Controllers\AuthController@login');
$api->post('auth/signup', 'App\Api\V1\Controllers\AuthController@signup');
$api->post('auth/recovery', 'App\Api\V1\Controllers\AuthController@recovery');
$api->post('auth/reset', 'App\Api\V1\Controllers\AuthController@reset');
// example of protected route
$api->get('protected', ['middleware' => ['api.auth'], function () {
return \App\User::all();
}]);
// example of free route
$api->get('free', function() {
return \App\User::all();
});
$api->group(['middleware' => 'api.auth'], function ($api) {
$api->post('driver/store', 'App/Api/V1/Controllers/DriverController@store');
$api->post('driver', 'App/Api/V1/Controllers/DriverController@index');
});
});
if i should remove the route group, the the other routes would work, i have checked the namespace declaration in my controller and it was correct, did composer autoload and yet none has worked for me yet.