Problem with Routes Laravel 5

1

I've arranged my Controllers for folders: Ex: Panel / Concessionaire / Trademarks - > CarrosController.php

On Route I tried to report this way

Route::get('Painel\Concessesionaria\Marcas', ['as' => 'marcas', function () {

Route::get('marcas', 'MarcasController@index');
Route::post('marcas/view', 'MarcasController@view');
Route::post('marcas/add', 'MarcasController@add');
Route::post('marcas/delete', 'MarcasController@delete');
Route::post('marcas/edit', 'MarcasController@edit');
Route::post('marcas/update', 'MarcasController@update');

}]);

But you're bringing the following error localhost: 8000 / local

NotFoundHttpException in RouteCollection.php

    
asked by anonymous 28.04.2016 / 22:47

2 answers

2

The local route you've accessed is not registered, try doing this and access localhost: 8000 /

Route::group(['prefix' => 'marcas'], function () {

    Route::get('/', 'Painel\Concessesionaria\Marcas\MarcasController@index');
    Route::post('/view', 'Painel\Concessesionaria\Marcas\MarcasController@view');
    Route::post('/add', 'Painel\Concessesionaria\Marcas\MarcasController@add');
    Route::post('/delete', 'Painel\Concessesionaria\Marcas\MarcasController@delete');
    Route::post('/edit', 'Painel\Concessesionaria\Marcas\MarcasController@edit');
    Route::post('/update', 'Painel\Concessesionaria\Marcas\MarcasController@update');

});
    
28.04.2016 / 23:04
0

The first parameter you are passing to get method is not the folder of your controllers, you must pass as the first parameter p link of your route. For this reason you are returning this error.

Change this way for each route:

Route::get('marcas', 'Painel\Concessesionaria\Marcas\MarcasController@index');
    
28.04.2016 / 22:57