0
I want to create a dynamic routing system, without having to code gambiarras.
Come on.
I have the Routes:
Route::group([
'middleware' => ['web'],
'namespace' => 'LaraShop\Front\Http\Controllers',
'as' => 'page'
], function()
{
/*
* Páginas padrão
*/
Route::get('/', 'HomeController@index')->name('.home');
Route::get('/contato', 'PagesController@show')->name('.contact');
/*
* Rotas Dinâmicas
*/
Route::get('{page}', 'PagesController@getPage');
});
Route::group([
'middleware' => ['web', 'auth'],
'namespace' => 'LaraShop\Admin\Http\Controllers',
'as' => 'admin'
], function() {
// rotas do admin
});
The point is, what’s the best way to {page}
go through the /admin route without causing an error?
It is not correct this route because it will clash with
/
, with/contato
etc ... cannot have something dynamic at the root if there are other routes that have the same nomenclature.– novic