group(function () { Route::get('agent/form/{element}', 'AgentAPIController@form'); Route::resource('agent', 'AgentAPIController'); }); // 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 agents Route::prefix('{guard}/agent')->group(function () { Route::get('agent/form/{element}', 'AgentAPIController@form'); Route::apiResource('agent', 'AgentAPIController'); }); // Public routes for agents Route::get('agent/Agent', 'AgentPublicController@getAgent'); } ); }