I want to create a dynamic route 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 question is, what is the best way for {page}
to go through route / admin without causing an error?