group(function () { Route::get('buyer/form/{element}', 'BuyerAPIController@form'); Route::resource('buyer', 'BuyerAPIController'); }); // Public routes for buyer Route::get('buyers/', 'BuyerPublicController@index'); Route::get('buyers/{slug?}', 'BuyerPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for buyers Route::prefix('{guard}/buyer')->group(function () { Route::get('buyer/form/{element}', 'BuyerAPIController@form'); Route::apiResource('buyer', 'BuyerAPIController'); }); // Public routes for buyers Route::get('buyer/Buyer', 'BuyerPublicController@getBuyer'); } ); } // API routes for costcenter Route::prefix('{guard}/buyer')->group(function () { Route::get('costcenter/form/{element}', 'CostcenterAPIController@form'); Route::resource('costcenter', 'CostcenterAPIController'); }); // Public routes for costcenter Route::get('buyers/', 'CostcenterPublicController@index'); Route::get('buyers/{slug?}', 'CostcenterPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for buyers Route::prefix('{guard}/buyer')->group(function () { Route::get('costcenter/form/{element}', 'CostcenterAPIController@form'); Route::apiResource('costcenter', 'CostcenterAPIController'); }); // Public routes for buyers Route::get('buyer/Costcenter', 'CostcenterPublicController@getCostcenter'); } ); }