bind('boilerplate', function ($id) { $boilerplate = $this->app->make('\Boilerplate\Boilerplate\Interfaces\BoilerplateRepositoryInterface'); return $boilerplate->findorNew($id); }); } if (Request::is('*/boilerplate/boilerplate_i18n/*')) { $router->bind('boilerplate_i18n', function ($id) { $boilerplate_i18n = $this->app->make('\Boilerplate\Boilerplate\Interfaces\BoilerplateI18nRepositoryInterface'); return $boilerplate_i18n->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'; }); } }