bind('product', function ($id) { $product = $this->app->make('\Guru\Product\Interfaces\ProductRepositoryInterface'); return $product->findorNew($id); }); }if (Request::is('*/product/category/*')) { $router->bind('category', function ($id) { $category = $this->app->make('\Guru\Product\Interfaces\CategoryRepositoryInterface'); return $category->findorNew($id); }); }if (Request::is('*/product/price/*')) { $router->bind('price', function ($id) { $price = $this->app->make('\Guru\Product\Interfaces\PriceRepositoryInterface'); return $price->findorNew($id); }); } } /** * Define the routes for the application. * * @param \Illuminate\Routing\Router $router * * @return void */ public function map(Router $router) { $router->group(['namespace' => $this->namespace], function ($router) { require __DIR__ . '/../Http/routes.php'; }); } }