setRootControllerNamespace(); if ($this->app->routesAreCached()) { $this->loadCachedRoutes(); } else { $this->loadRoutes(); $this->app->booted(function () { $this->app['router']->getRoutes()->refreshNameLookups(); $this->app['router']->getRoutes()->refreshActionLookups(); }); } } /** * Set the root controller namespace for the application. * * @return void */ protected function setRootControllerNamespace() { if (! is_null($this->namespace)) { $this->app[UrlGenerator::class]->setRootControllerNamespace($this->namespace); } } /** * Load the cached routes for the application. * * @return void */ protected function loadCachedRoutes() { $this->app->booted(function () { require $this->app->getCachedRoutesPath(); }); } /** * Load the application routes. * * @return void */ protected function loadRoutes() { if (method_exists($this, 'map')) { $this->app->call([$this, 'map']); } } /** * Register the service provider. * * @return void */ public function register() { // } /** * Pass dynamic methods onto the router instance. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { return $this->forwardCallTo( $this->app->make(Router::class), $method, $parameters ); } }