Barryvdh\Debugbar\ServiceProvider::boot PHP Метод

boot() публичный Метод

Bootstrap the application events.
public boot ( ) : void
Результат void
    public function boot()
    {
        $app = $this->app;
        $configPath = __DIR__ . '/../config/debugbar.php';
        $this->publishes([$configPath => $this->getConfigPath()], 'config');
        // If enabled is null, set from the app.debug value
        $enabled = $this->app['config']->get('debugbar.enabled');
        if (is_null($enabled)) {
            $enabled = $this->checkAppDebug();
        }
        if (!$enabled) {
            return;
        }
        $routeConfig = ['namespace' => 'Barryvdh\\Debugbar\\Controllers', 'prefix' => $this->app['config']->get('debugbar.route_prefix')];
        $this->getRouter()->group($routeConfig, function ($router) {
            $router->get('open', ['uses' => 'OpenHandlerController@handle', 'as' => 'debugbar.openhandler']);
            $router->get('clockwork/{id}', ['uses' => 'OpenHandlerController@clockwork', 'as' => 'debugbar.clockwork']);
            $router->get('assets/stylesheets', ['uses' => 'AssetController@css', 'as' => 'debugbar.assets.css']);
            $router->get('assets/javascript', ['uses' => 'AssetController@js', 'as' => 'debugbar.assets.js']);
        });
        if ($app->runningInConsole() || $app->environment('testing')) {
            return;
        }
        /** @var LaravelDebugbar $debugbar */
        $debugbar = $this->app['debugbar'];
        $debugbar->enable();
        $debugbar->boot();
        $this->registerMiddleware('Barryvdh\\Debugbar\\Middleware\\Debugbar');
    }