group(function () { Route::get('faq/form/{element}', 'FaqAPIController@form'); Route::resource('faq', 'FaqAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for faqs Route::prefix('{guard}/faq')->group(function () { Route::get('faq/form/{element}', 'FaqAPIController@form'); Route::apiResource('faq', 'FaqAPIController'); }); // Public routes for faqs Route::get('faq/Faq', 'FaqPublicController@getFaq'); } ); } // API routes for categories Route::prefix('{guard}/faq')->group(function () { Route::get('categories/form/{element}', 'CategoriesAPIController@form'); Route::resource('categories', 'CategoriesAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for faqs Route::prefix('{guard}/faq')->group(function () { Route::get('categories/form/{element}', 'CategoriesAPIController@form'); Route::apiResource('categories', 'CategoriesAPIController'); }); // Public routes for faqs Route::get('faq/Categories', 'CategoriesPublicController@getCategories'); } ); }