group(function () { Route::get('contact_category/form/{element}', 'ContactCategoryAPIController@form'); Route::resource('contact_category', 'ContactCategoryAPIController'); }); // Public routes for contact_category Route::get('contacts/', 'ContactCategoryPublicController@index'); Route::get('contacts/{slug?}', 'ContactCategoryPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for contacts Route::prefix('{guard}/contact')->group(function () { Route::get('contact_category/form/{element}', 'ContactCategoryAPIController@form'); Route::apiResource('contact_category', 'ContactCategoryAPIController'); }); // Public routes for contacts Route::get('contact/ContactCategory', 'ContactCategoryPublicController@getContactCategory'); } ); } // API routes for contact Route::prefix('{guard}/contact')->group(function () { Route::get('contact/form/{element}', 'ContactAPIController@form'); Route::resource('contact', 'ContactAPIController'); }); // Public routes for contact Route::get('contacts/', 'ContactPublicController@index'); Route::get('contacts/{slug?}', 'ContactPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for contacts Route::prefix('{guard}/contact')->group(function () { Route::get('contact/form/{element}', 'ContactAPIController@form'); Route::apiResource('contact', 'ContactAPIController'); }); // Public routes for contacts Route::get('contact/Contact', 'ContactPublicController@getContact'); } ); }