bind('product', function ($id) { $product = $this->app->make('\Xetam\Storefront\Interfaces\ProductRepositoryInterface'); return $product->findorNew($id); }); } if (Request::is('*/storefront/product/*')) { $router->bind('product', function ($id) { $product = $this->app->make('\Xetam\Storefront\Interfaces\ProductRepositoryInterface'); return $product->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'; }); } }