app->make('Laraecart\Cart\Interfaces\CartRepositoryInterface'); return $cartrepo->findorNew($cart); }); } if (Request::is('*/cart/address/*')) { Route::bind('address', function ($address) { $addressrepo = $this->app->make('Laraecart\Cart\Interfaces\AddressRepositoryInterface'); return $addressrepo->findorNew($address); }); } if (Request::is('*/cart/order/*')) { Route::bind('order', function ($order) { $orderrepo = $this->app->make('Laraecart\Cart\Interfaces\OrderRepositoryInterface'); return $orderrepo->findorNew($order); }); } if (Request::is('*/cart/details/*')) { Route::bind('details', function ($details) { $detailsrepo = $this->app->make('Laraecart\Cart\Interfaces\DetailsRepositoryInterface'); return $detailsrepo->findorNew($details); }); } if (Request::is('*/cart/history/*')) { Route::bind('history', function ($history) { $historyrepo = $this->app->make('Laraecart\Cart\Interfaces\HistoryRepositoryInterface'); return $historyrepo->findorNew($history); }); } } /** * Define the routes for the package. * * @return void */ public function map() { $this->mapWebRoutes(); } /** * Define the "web" routes for the package. * * These routes all receive session state, CSRF protection, etc. * * @return void */ protected function mapWebRoutes() { if (request()->segment(1) == 'api' || request()->segment(2) == 'api') { return; } Route::group([ 'middleware' => 'web', 'namespace' => $this->namespace, 'prefix' => trans_setlocale(), ], function ($router) { require (__DIR__ . '/../../routes/web.php'); }); } }