app->make('Ebuy\Product\Interfaces\GroupRepositoryInterface'); return $grouprepo->findorNew($group); }); } if (Request::is('*/product/attribute/*')) { Route::bind('attribute', function ($attribute) { $attributerepo = $this->app->make('Ebuy\Product\Interfaces\AttributeRepositoryInterface'); return $attributerepo->findorNew($attribute); }); } if (Request::is('*/product/product_attribute/*')) { Route::bind('product_attribute', function ($product_attribute) { $product_attributerepo = $this->app->make('Ebuy\Product\Interfaces\ProductAttributeRepositoryInterface'); return $product_attributerepo->findorNew($product_attribute); }); } if (Request::is('*/product/product_group/*')) { Route::bind('product_group', function ($product_group) { $product_grouprepo = $this->app->make('Ebuy\Product\Interfaces\ProductGroupRepositoryInterface'); return $product_grouprepo->findorNew($product_group); }); } } /** * 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() { Route::group([ 'middleware' => 'web', 'namespace' => $this->namespace, ], function ($router) { require (__DIR__ . '/../../routes/web.php'); }); } /** * Define the "api" routes for the package. * * These routes are typically stateless. * * @return void */ protected function mapApiRoutes() { Route::group([ 'middleware' => 'api', 'namespace' => $this->namespace, 'prefix' => 'api', ], function ($router) { require (__DIR__ . '/../../routes/api.php'); }); } }