app->make('Tadascript\Sale\Interfaces\WarehouseRepositoryInterface'); return $warehouserepo->findorNew($warehouse); }); } if (Request::is('*/sale/status/*')) { Route::bind('status', function ($status) { $statusrepo = $this->app->make('Tadascript\Sale\Interfaces\StatusRepositoryInterface'); return $statusrepo->findorNew($status); }); } if (Request::is('*/sale/quote/*')) { Route::bind('quote', function ($quote) { $quoterepo = $this->app->make('Tadascript\Sale\Interfaces\QuoteRepositoryInterface'); return $quoterepo->findorNew($quote); }); } if (Request::is('*/sale/quote_item/*')) { Route::bind('quote_item', function ($quote_item) { $quote_itemrepo = $this->app->make('Tadascript\Sale\Interfaces\QuoteItemRepositoryInterface'); return $quote_itemrepo->findorNew($quote_item); }); } if (Request::is('*/sale/order/*')) { Route::bind('order', function ($order) { $orderrepo = $this->app->make('Tadascript\Sale\Interfaces\OrderRepositoryInterface'); return $orderrepo->findorNew($order); }); } if (Request::is('*/sale/order_item/*')) { Route::bind('order_item', function ($order_item) { $order_itemrepo = $this->app->make('Tadascript\Sale\Interfaces\OrderItemRepositoryInterface'); return $order_itemrepo->findorNew($order_item); }); } if (Request::is('*/sale/transaction/*')) { Route::bind('transaction', function ($transaction) { $transactionrepo = $this->app->make('Tadascript\Sale\Interfaces\TransactionRepositoryInterface'); return $transactionrepo->findorNew($transaction); }); } } /** * Define the routes for the package. * * @return void */ public function map() { $this->mapWebRoutes(); $this->mapApiRoutes(); } /** * 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'); }); } /** * Define the "api" routes for the package. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { if(request()->segment(1) != 'api' && request()->segment(2) != 'api') { return; } Route::group([ 'middleware' => 'api', 'namespace' => $this->namespace, 'prefix' => trans_setlocale() . '/api', ], function ($router) { require (__DIR__ . '/../../routes/api.php'); }); } }