bind('offer', function ($id) { $offer = $this->app->make('\Guru\Offer\Interfaces\OfferRepositoryInterface'); return $offer->findorNew($id); }); }if (Request::is('*/offer/category/*')) { $router->bind('category', function ($id) { $category = $this->app->make('\Guru\Offer\Interfaces\CategoryRepositoryInterface'); return $category->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'; }); } }