Boot the Laravel application object.
@return Application
@throws ModuleConfig
481710
private function loadApplication()
    {
        $app = require $this->module->config['bootstrap_file'];
        $app->loadEnvironmentFrom($this->module->config['environment_file']);
        $app->instance('request', new Request());

        return $app;
    }
506446
public function boot()
	{
		$path = $this->laravel['path'].'/config/wel.php';

		if (file_exists($path))
		{
			require $path;
		}

		// If the event dispatcher is set on the application, we will fire an event
		// with the Artisan instance to provide each listener the opportunity to
		// register their commands on this application before it gets started.
		if (isset($this->laravel['events']))
		{
			$this->laravel['events']
				->fire('artisan.start', array($this));
		}

		return $this;
	}
235159
protected function bootApplication(): void
    {
        $this->registerBaseServices();

        try {
            $memory = $this->bootInstalledApplication();
        } catch (Exception $e) {
            $memory = $this->bootNewApplication();
        }

        $this->services['memory'] = $memory;
        $this->app->instance('orchestra.platform.memory', $memory);

        $this->registerComponents($memory);

        $this->app->make('events')->dispatch('orchestra.started', [$memory]);
    }
1045231
public function boot()
	{
		if(preg_match('/^4/',Application::VERSION))
		{
			$this->package('gwnobots/laravel-head');
		}
		else 
		{
			$configPath = __DIR__.'/../../config/config.php';
			$this->publishes([
				$configPath => config_path('laravel-head.php'),
			]);
			
			$this->mergeConfigFrom($configPath, 'laravel-head');
		}
	}
1087485
public function boot()
    {
        $this->bootConfig();
        $this->app['validator']->extend('captcha', function ($attribute, $value) {
            return $this->app['captcha']->verifyResponse($value, $this->app['request']->getClientIp());
        });
    }
582078
public function boot()
    {

        $this->publishes([
            __DIR__ . '/../../config/widget.php' => config_path('widget.php'),
        ], 'config');


        Blade::directive('widget', function ($expression) {
            $segments = explode(',', preg_replace("/[\(\)\\\]/", '', $expression));

            if (!array_key_exists(1, $segments)) {
                return '<?php echo (new \Orchid\Widget\Widget)->get(' . $segments[0] . '); ?>';
            }

            return '<?php echo (new \Orchid\Widget\Widget)->get(' . $segments[0] . ',' . $segments[1] . '); ?>';
        });
    }
434506
public function boot()
    {
        $app = $this->app;

        if (!$app->runningInConsole()) {
            return;
        }

        $source = realpath(__DIR__ . '/config/config.php');

        if (class_exists('Illuminate\Foundation\Application', false)) {
            // L5
            $this->publishes([$source => config_path('sniffer-rules.php')]);
            $this->mergeConfigFrom($source, 'sniffer-rules');
        } elseif (class_exists('Laravel\Lumen\Application', false)) {
            // Lumen
            $app->configure('sniffer-rules');
            $this->mergeConfigFrom($source, 'sniffer-rules');
        } else {
            // L4
            $this->package('socialengine/sniffer-rules', null, __DIR__);
        }
    }
1156044
public function bootstrap()
    {

        // Start the rudimental system
        try {

            // Load settingsfile
            $this->loadSettings();

            // From here starts output buffering
            ob_start();

            // Registe PSR classloader
            $this->registerClassloader();

            // Create core DI container instance and map the instance to comntainer
            $this->di = \Core\DI\DI::getInstance();
            $this->di->mapValue('core.di', $this->di);

            $this->initLogger();

            // Run inits
            $this->initDatabase();
            $this->initMessageHandler();
            $this->initDependencies();
            $this->initHttp();
            $this->initSession();
            $this->initConfig();
            $this->initMailer();
            $this->initRouter();

            // Get an instance of Core app
            $this->getAppInstance('Core');

            $this->initSecurity();
            $this->initPage();
            $this->initAssetManager();

            // Run highlevel system
            $this->autodiscoverApps();

            // Match request against the generic routes to get the ajax request flag and to match a fallback result.
            $this->router->match();

            // Initiate apps
            $this->initApps();

            // Match routes again as now possible app routes are available
            $this->router->match();

            // Run dispatcher
            $result = $this->dispatch();

            // Send mails
            $this->mailer->send();

            // Process all assets
            $this->processAssets();

            // Send cookies
            $this->http->cookies->send();

            // Redirect requested?
            if (!empty($_SESSION['Core']['redirect'])) {

                $this->http->header->location($_SESSION['Core']['redirect']['location'], $_SESSION['Core']['redirect']['permanent']);
                $this->http->header->send();

                // Important: Clear redirect from session!
                unset($_SESSION['Core']['redirect']);

                return;
            }

            switch ($this->router->getFormat()) {

                case 'file':
                    $sendfile = new Sendfile($result);
                    $sendfile->send();

                    break;

                case 'html':

                    $this->http->header->contentType('text/html', 'utf-8');

                    $language = $this->getAppInstance('Core')->language;

                    // Add logoff button for logged in users
                    if ($this->user->isGuest()) {
                        $this->page->menu->createItem('register', $language->get('menu.register'), $this->router->generate('core.register'));
                        $this->page->menu->createItem('login', $language->get('menu.login'), $this->router->generate('core.login', [
                            'action' => 'login'
                        ]));
                    }

                    // or add login and register buttons. But not when current user is currently on banlist
                    else {

                        $usermenu = $this->page->menu->createItem('login', $this->user->getDisplayname());

                        // Show admin menu?
                        if ($this->user->getAdmin()) {
                            $usermenu->createItem('admin', $language->get('menu.admin'), $this->router->generate('core.admin'));
                        }

                        $usermenu->createItem('logout', $language->get('menu.logout'), $this->router->generate('core.login', [
                            'action' => 'logout'
                        ]));
                    }

                    $this->page->setHome($this->config->get('Core', 'url.home'));
                    $this->page->setContent($result);

                    $result = $this->page->render();
            }

            // Send headers so far
            $this->http->header->send();
        }
        catch (\Throwable $t) {

            $error = new ErrorHandler($t);
            $error->setAjax(isset($_REQUEST['ajax']));
            $error->setPublic(isset($this->user) && $this->user->getAdmin());
            $error->setPublic(true);

            if (isset($this->logger)) {
                $error->setLogger($this->logger);
            }

            http_response_code(500);

            $result = $error->handle();
        }

        echo $result;

        ob_end_flush();
    }
1106649
public function boot()
    {
        $this->package('abodeo/laravel-stripe');

        /*
         * Load Stripe configuration
         *
         * API keys should be utilizing Laravel's "dot files" to keep them out of source
         * control and making them easily overridable on dev environments
         *
         * Read more: http://laravel.com/docs/configuration#environment-configuration
         */
        $api_key = isset($_ENV['stripe.api_key']) ? $_ENV['stripe.api_key'] : $this->app['config']->get('laravel-stripe::stripe.api_key');
        Stripe::setApiKey($api_key);

        $publishableKey = isset($_ENV['stripe.publishable_key']) ? $_ENV['stripe.publishable_key'] : $this->app['config']->get('laravel-stripe::stripe.publishable_key');

        /*
         * Register blade compiler for the Stripe publishable key.
         */
        $blade = $this->app['view']->getEngineResolver()->resolve('blade')->getCompiler();
        $blade->extend(function($value, $compiler) use($publishableKey)
            {
                $matcher = "/(?<!\w)(\s*)@stripeKey/";

                return preg_replace($matcher, $publishableKey, $value);
            });
    }
909594
public function boot()
    {
        Storage::extend('oss', function ($app, $config) {
            $accessId = $config['access_id'];
            $accessKey = $config['access_key'];
            $endPoint = $config['endpoint'];
            $bucket = $config['bucket'];

            $prefix = null;
            if (isset($config['prefix'])) {
                $prefix = $config['prefix'];
            }

            $client = new OssClient($accessId, $accessKey, $endPoint);
            $adapter = new AliyunOssAdapter($client, $bucket, $prefix);

            $filesystem = new Filesystem($adapter);
            $filesystem->addPlugin(new PutFile());
            $filesystem->addPlugin(new SignedDownloadUrl());

            return $filesystem;
        });
    }
46501
public function boot()
    {
        // routs
        if (!$this->app->routesAreCached()) {
            require $this->moduleDir('routes/platformAdmin-routes.php');
        }

        // register views int the form of platformAdmin::home
        $this->loadViewsFrom($this->moduleDir('public/views'), 'platformAdmin');

        // register vendor resources
        $this->publishes([
            $this->moduleDir('public/resources') => public_path('vendor/platformAdmin'),
        ], 'public');

        $this->publishes([
            $this->moduleDir('migrations') => database_path('migrations'),
        ], 'migrations');

    }
1222689
public function bootstrap(): self
    {
        if (!$this->info->installMode()) {
            $this->getApplicationInitializer()->init($this);
            $this->emit('system.init');

            return $this;
        }

        $manager = $this->moduleManager();

        /** @var Module|null $installer */
        $installer = null;

        foreach ($manager->modules() as $module) {
            if ($module->isApplicationInstaller()) {
                if ($installer !== null) {
                    $formatText = '%s was defined as an application installer before %s';
                    $formatArgs = [$installer->name(), $module->name()];
                    throw new \RuntimeException(vsprintf($formatText, $formatArgs));
                }

                $installer = $module;
            }
        }

        if ($installer === null) {
            throw new \RuntimeException("No application installer was found");
        }

        $enabled = [$installer->name() => Module::ENABLED];

        foreach ($manager->recursiveDependencies($installer) as $module) {
            $enabled[$module->name()] = Module::ENABLED;
        }

        $this->getApplicationInitializer()->init($this);
        $manager->setStatusList($enabled);

        $this->emit('system.init');

        return $this;
    }
1146866
public function boot()
    {

        $this->mergeConfigFrom(
            dirname(__FILE__) . '/config/es.php', 'es'
        );

        $this->publishes([
            dirname(__FILE__) . '/config/' => config_path(),
        ], "es.config");

        // Auto configuration with lumen framework.

        if (str_contains($this->app->version(), 'Lumen')) {
            $this->app->configure("es");
        }

        // Resolve Laravel Scout engine.

        if (class_exists("Laravel\\Scout\\EngineManager")) {

            try {

                $this->app->make(EngineManager::class)->extend('es', function () {

                    $config = config('es.connections.' . config('scout.es.connection'));

                    return new ScoutEngine(
                        ElasticBuilder::create()->setHosts($config["servers"])->build(),
                        $config["index"]
                    );

                });

            } catch (BindingResolutionException $e) {

                // Class is not resolved.
                // Laravel Scout service provider was not loaded yet.

            }

        }


    }
920589
private function bootModules()
    {
        foreach ($this->app['modules']->enabled() as $module) {
            $this->registerViewNamespace($module);
            $this->registerLanguageNamespace($module);
            $this->registerConfigNamespace($module);
        }
    }
423756
public function boot()
    {

        // If we are in debug mode, listen to database events
        // and log queries to the log file.
        if (env('DB_DEBUG', false)) {

            DB::listen(function ($query) {

                $positional = 0;
                $full_query = '';

                foreach (str_split($query->sql) as $char) {

                    if ($char === '?') {

                        $value = $query->bindings[$positional];

                        if (is_scalar($value))
                            $full_query = $full_query . '"' . $value . '"';
                        else
                            $full_query = $full_query . '[' . gettype($value) . ']';

                        $positional++;

                    } else {

                        $full_query = $full_query . $char;

                    }
                }

                logger()->debug(' ---> QUERY DEBUG: ' . $full_query . ' <---');

            });
        }

        // Inform Laravel how to load migrations
        $this->add_migrations();
    }
1325455
public function boot()
    {
        $source = realpath($raw = __DIR__ . '/Config.php') ?: $raw;

        if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
            $this->publishes([$source => config_path('mutex.php')]);
        } elseif ($this->app instanceof LumenApplication) {
            $this->app->configure('mutex');
        }

        $this->mergeConfigFrom($source, 'mutex');
    }
139026
public function boot()
    {
        $this->app[EngineManager::class]->extend('tntsearch', function ($app) {
            $tnt = new TNTSearch();

            $driver = config('database.default');
            $config = config('scout.tntsearch') + config("database.connections.{$driver}");

            $tnt->loadConfig($config);
            $tnt->setTokenizer(app('tntsearch.tokenizer')->driver());
            $tnt->setDatabaseHandle(app('db')->connection()->getPdo());

            $this->setFuzziness($tnt);
            $this->setAsYouType($tnt);

            return new TNTSearchEngine($tnt);
        });
    }