/** * @param Application $app */ public function bootstrap(Application $app) { foreach ($this->getConfigFiles($app) as $key => $path) { $this->config->set($key, require $path); } $app->setEnvironment($this->config->get('app.env', 'production')); date_default_timezone_set($this->config->get('app.timezone', 'UTC')); mb_internal_encoding('UTF-8'); }
/** * @param Router $router * * @return mixed */ public function loadRoutes(Router $router) { $binders = $this->config->get($this->app->getContext() . '.routes', []); foreach ($binders as $binder) { if (!class_exists($binder)) { throw new InvalidArgumentException('RouteBinder [' . $binder . '] does not exist'); } $this->container->make($binder)->bind($router); } }