/** * @return \Closure */ protected function dispatchToRouter() { return function ($request) { $this->app->instance('request', $request); return $this->router->dispatch($request); }; }
/** * @return $this */ public function init() { $config = Arr::collapse([$this->loadIlluminateConfiguration(), $this->loadFiledConfiguration()]); $this->application->instance('env', 'production'); $this->application->instance('config', new Repository($config)); $this->application->registerConfiguredProviders(); $this->application->singleton(HttpKernelContract::class, HttpKernel::class); $this->application->singleton(ConsoleKernelContract::class, ConsoleKernel::class); $this->application->singleton(ExceptionHandler::class, Handler::class); if ($this->application->isInstalled()) { $this->application->register(ThemeServiceProvider::class); $this->application->register(MenuServiceProvider::class); $this->application->register(CategoryServiceProvider::class); $this->application->register(ArticleServiceProvider::class); $this->application->register(HttpServiceProvider::class); $this->application->register(PageServiceProvider::class); $this->application->register(AdminServiceProvider::class); } else { $this->application->register(InstallServiceProvider::class); } return $this; }
/** * Define the application's command schedule. */ protected function defineConsoleSchedule() { $this->app->instance('Illuminate\\Console\\Scheduling\\Schedule', $schedule = new Schedule()); $this->schedule($schedule); }