group(function () { Route::resource('service', 'ServiceResourceController'); }); // Public routes for service Route::get('services/', 'ServicePublicController@index'); Route::get('services/{slug?}', 'ServicePublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'ServiceResourceController'); }); // Public routes for pages Route::get('services/', 'ServicePublicController@index'); Route::get('services/{slug?}', 'ServicePublicController@show'); } ); } // web routes for service_category Route::prefix('{guard}/service')->group(function () { Route::resource('service_category', 'ServiceCategoryResourceController'); }); // Public routes for service_category Route::get('services/', 'ServiceCategoryPublicController@index'); Route::get('services/{slug?}', 'ServiceCategoryPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'ServiceCategoryResourceController'); }); // Public routes for pages Route::get('services/', 'ServiceCategoryPublicController@index'); Route::get('services/{slug?}', 'ServiceCategoryPublicController@show'); } ); } // web routes for service_review Route::prefix('{guard}/service')->group(function () { Route::resource('service_review', 'ServiceReviewResourceController'); }); // Public routes for service_review Route::get('services/', 'ServiceReviewPublicController@index'); Route::get('services/{slug?}', 'ServiceReviewPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'ServiceReviewResourceController'); }); // Public routes for pages Route::get('services/', 'ServiceReviewPublicController@index'); Route::get('services/{slug?}', 'ServiceReviewPublicController@show'); } ); }