group(function () { Route::get('supplier/form/{element}', 'SupplierAPIController@form'); Route::resource('supplier', 'SupplierAPIController'); }); // Public routes for supplier Route::get('suppliers/', 'SupplierPublicController@index'); Route::get('suppliers/{slug?}', 'SupplierPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for suppliers Route::prefix('{guard}/supplier')->group(function () { Route::get('supplier/form/{element}', 'SupplierAPIController@form'); Route::apiResource('supplier', 'SupplierAPIController'); }); // Public routes for suppliers Route::get('supplier/Supplier', 'SupplierPublicController@getSupplier'); } ); } // API routes for contract Route::prefix('{guard}/supplier')->group(function () { Route::get('contract/form/{element}', 'ContractAPIController@form'); Route::resource('contract', 'ContractAPIController'); }); // Public routes for contract Route::get('suppliers/', 'ContractPublicController@index'); Route::get('suppliers/{slug?}', 'ContractPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for suppliers Route::prefix('{guard}/supplier')->group(function () { Route::get('contract/form/{element}', 'ContractAPIController@form'); Route::apiResource('contract', 'ContractAPIController'); }); // Public routes for suppliers Route::get('supplier/Contract', 'ContractPublicController@getContract'); } ); }