MarvinLabs\SetupWizard\ServiceProvider::boot PHP Méthode

boot() public méthode

Register any other events for your application.
public boot ( ) : void
Résultat void
    public function boot()
    {
        parent::boot();
        $config = $this->app['config'];
        // Add the setup wizard routes if asked to
        $loadDefaultRoutes = $config->get('setup_wizard.routing.load_default');
        if ($loadDefaultRoutes && !$this->app->routesAreCached()) {
            require $this->packageDir . '/src/routes.php';
        }
        // Facade
        $this->app->singleton('SetupWizard', function ($app) {
            $wizard = new DefaultSetupWizard($app);
            return $wizard;
        });
        $this->app->alias('SetupWizard', DefaultSetupWizard::class);
        // We have some views and translations for the wizard
        $this->loadViewsFrom($this->packageDir . '/resources/views', self::$RES_NAMESPACE);
        $this->loadTranslationsFrom($this->packageDir . '/resources/lang', self::$RES_NAMESPACE);
        // We publish some files to override if required
        $this->publishes([$this->packageDir . '/config/' . self::$CONFIG_FILE => config_path(self::$CONFIG_FILE)], 'config');
        $this->publishes([$this->packageDir . '/resources/views' => resource_path('views/vendor/' . self::$RES_NAMESPACE)], 'views');
        $this->publishes([$this->packageDir . '/resources/lang' => resource_path('lang/vendor/' . self::$RES_NAMESPACE)], 'translations');
        $this->publishes([$this->packageDir . '/resources/assets' => public_path('vendor/' . self::$RES_NAMESPACE)], 'assets');
    }