group(function () { Route::resource('agent', 'AgentResourceController'); }); // Public routes for agent Route::get('agents/', 'AgentPublicController@index'); Route::get('agents/{slug?}', 'AgentPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'AgentResourceController'); }); // Public routes for pages Route::get('agents/', 'AgentPublicController@index'); Route::get('agents/{slug?}', 'AgentPublicController@show'); } ); }