group(function () { Route::get('company/form/{element}', 'CompanyAPIController@form'); Route::resource('company', 'CompanyAPIController'); }); // Public routes for company Route::get('companies/', 'CompanyPublicController@index'); Route::get('companies/{slug?}', 'CompanyPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('company/form/{element}', 'CompanyAPIController@form'); Route::apiResource('company', 'CompanyAPIController'); }); // Public routes for companies Route::get('company/Company', 'CompanyPublicController@getCompany'); } ); } // API routes for role Route::prefix('{guard}/company')->group(function () { Route::get('role/form/{element}', 'RoleAPIController@form'); Route::resource('role', 'RoleAPIController'); }); // Public routes for role Route::get('companies/', 'RolePublicController@index'); Route::get('companies/{slug?}', 'RolePublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('role/form/{element}', 'RoleAPIController@form'); Route::apiResource('role', 'RoleAPIController'); }); // Public routes for companies Route::get('company/Role', 'RolePublicController@getRole'); } ); } // API routes for member Route::prefix('{guard}/company')->group(function () { Route::get('member/form/{element}', 'MemberAPIController@form'); Route::resource('member', 'MemberAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('member/form/{element}', 'MemberAPIController@form'); Route::apiResource('member', 'MemberAPIController'); }); // Public routes for companies Route::get('company/Member', 'MemberPublicController@getMember'); } ); }