Pessoal estou desenvolvendo uma api rest usando laravel e para criar essa api estou usando o tutorial:
- https://rafaell-lycan.com/2015/construindo-restful-api-laravel-parte-1/
- https://rafaell-lycan.com/2015/construindo-restful-api-laravel-parte-2/
- https://rafaell-lycan.com/2015/construindo-restful-api-laravel-parte-3/
porem ao rodar o comando:
php artisan route:list
Me é apresentado o seguinte erro:
ReflectionException:Class App\Http\Controllers\pagesController does not exist
at /var/www/html/freelance/HQ Alma/api/vendor/laravel/framework/src/Illuminate/Container/Container.php:7
79
775| if ($concrete instanceof Closure) {
776| return $concrete($this, $this->getLastParameterOverride());
777|}
778|
779|$reflector = new ReflectionClass($concrete);
780|
781|// If the type is not instantiable, the developer is attempting to resolve
782|// an abstract type such as an Interface of Abstract Class and there is
783|// no binding registered for the abstractions so we need to bail out.
Exception trace:
1 ReflectionClass::__construct("App\Http\Controllers\pagesController")
/var/www/html/freelance/HQ Alma/api/vendor/laravel/framework/src/Illuminate/Container/Container.php:779
2 Illuminate\Container\Container::build("App\Http\Controllers\pagesController")
/var/www/html/freelance/HQ Alma/api/vendor/laravel/framework/src/Illuminate/Container/Container.php:658
Please use the argument -v to see more details.
Minhas rotas são essas:
Route::group(array('prefix' => 'hqi'), function()
{
Route::get('/', function () {
return response()->json(['message' => 'HQI API', 'status' =>
'Connected']);;
});
Route::resource('users', 'UserController');
Route::resource('pages', 'PagesController');
Route::resource('palestra', 'PalestrasDivulgacaoController');
});
Route::get('/', function () {
return redirect('api');
});
Alguem saberia oque pode ser?
PagesController
. Verifique o nome, local do arquivo e se ocomposer.json
está corretamente configurado, não esqueça de dar umdump-autoload
depoiscomposer dump-autoload
e ver se o Laravel passa a reconhecer sua rota.