group(function () { Route::get('plan/form/{element}', 'PlanAPIController@form'); Route::resource('plan', 'PlanAPIController'); }); // Public routes for plan Route::get('financial_plans/', 'PlanPublicController@index'); Route::get('financial_plans/{slug?}', 'PlanPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for financial_plans Route::prefix('{guard}/financial_plan')->group(function () { Route::get('plan/form/{element}', 'PlanAPIController@form'); Route::apiResource('plan', 'PlanAPIController'); }); // Public routes for financial_plans Route::get('financial_plan/Plan', 'PlanPublicController@getPlan'); } ); }