0
I can’t access the Laravel controller when I use:
Route::controller('categorias', 'CategoryController');
He makes the following mistake:
Invalidargumentexception Attribute [controller] does not exist.
However if I make another type of route:
Route::get('/about', 'CategoryController@store');
/(here he goes normally)/
What would be the problem?
Depending on the version you can use
Route::resource('name', '<controller>')
https://laravel.com/docs/5.8/controllers#Resource-controllers– SylvioT
This helped, but how could you pass only one controller on the route and be able to identify the types of HTTP requests (get, post, put, delete, options), that is, by setting in the Controller itself.
– Devprogramacao
I could give an example?
– SylvioT
I believe you are talking about this: https://stackoverflow.com/questions/23505875/laravel-routeresource-vs-routecontroller
– SylvioT