group(function () { Route::resource('product', 'ProductResourceController'); }); // Public routes for product Route::get('products/', 'ProductPublicController@index'); Route::get('products/{slug?}', 'ProductPublicController@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', 'ProductResourceController'); }); // Public routes for pages Route::get('products/', 'ProductPublicController@index'); Route::get('products/{slug?}', 'ProductPublicController@show'); } ); }