boot method.

@return null
966696
public static function bootHistorable()
    {
        static::created(function (Model $model) {
            $model->writeHistory('created', Str::limit($model->present()->title, 200, '…'), [], $model->toArray());
        });

        static::updated(function (Model $model) {
            $action = 'updated';

            $new = [];
            $old = [];
            foreach ($model->attributes as $key => $value) {
                if ($model->translatable and in_array($key, $model->translatable)) {
                    $values = (array) json_decode($value);
                    $originalValues = (array) json_decode($model->original[$key]);
                    foreach ($values as $locale => $newItem) {
                        if (isset($originalValues[$locale]) && $newItem !== $originalValues[$locale]) {
                            $new[$key][$locale] = $newItem;
                            $old[$key][$locale] = $originalValues[$locale];
                        }
                    }
                } else {
                    $originalValue = $model->original[$key];
                    if ($value != $originalValue) {
                        $new[$key] = $value;
                        $old[$key] = $originalValue;
                    }
                }
            }

            $model->writeHistory($action, Str::limit($model->present()->title, 200, '…'), $old, $new);
        });

        static::deleted(function (Model $model) {
            $model->writeHistory('deleted', Str::limit($model->present()->title, 200, '…'));
        });
    }
823208
public function boot()
    {
        $configFile = realpath(__DIR__ . '/../config/json-api.php');

        $this->mergeConfigFrom($configFile, 'json-api');
        $this->publishes([
            $configFile => config_path('json-api.php'),
        ]);

        if (config('json-api.routes.configure', false)) {
            if (!$this->app->routesAreCached()) {
                Route::group([], function (Router $router) {
                    require __DIR__ . '/../routes/api.php';
                });
            }
        }
    }
776693
public function boot()
    {
        $this->app->singleton(Connection::class, function() {
            return $this->app['db.connection'];
        });

        if (preg_match('/5\.[678]\.\d+/', $this->app->version())) {
            $this->app->singleton(\Illuminate\Hashing\HashManager::class, function ($app) {
                return new \Illuminate\Hashing\HashManager($app);
            });
        }

        if ($this->app->runningInConsole()) {
            $this->commands([
                Purge::class
            ]);
        }
    }
209387
public function boot()
    {
        parent::boot();

        if (!$this->getConfig('enabled')) {
            return false;
        }

        $this->loadRoutes();

        $this->registerErrorHandler();

        if (!isLaravel5()) {
            $this->bootTracker();
        }

        $this->loadTranslations();
    }
276136
public function boot()
    {
        parent::boot();

        if (Request::is('*/page/page/*')) {
            Route::bind('page', function ($id) {
                $page = $this->app->make(\Litecms\Page\Interfaces\PageRepositoryInterface::class);
                return $page->findOrNew($id);
            });
        }

    }
1030352
public function boot()
    {
        if ($this->app instanceof Laravel && $this->app->runningInConsole()) {
            $this->bootLaravelApplication();

        } elseif ($this->app instanceof Lumen) {
            $this->bootLumenApplication();
        }

        $this->mergeConfigFrom(__DIR__ . '/../resources/config/responder.php', 'responder');

        $this->commands([
            MakeTransformer::class
        ]);

        include __DIR__ . '/helpers.php';
    }
287130
public function boot() : void
    {
        $kernel = app(Kernel::class);

        if (class_uses_trait($kernel, RegistersRouters::class)) {
            $kernel->bootRouters();
        }
    }
99885
public function boot()
    {
        $path = \realpath(__DIR__.'/../');

        $this->addConfigComponent('orchestra/memory', 'orchestra/memory', "{$path}/config");

        if (! $this->hasPackageRepository()) {
            $this->bootUnderLaravel($path);
        }

        $this->loadMigrationsFrom([
            "{$path}/database/migrations",
        ]);

        $this->bootMemoryEvent();
    }
1230097
public static function boot()
    {
        parent::boot();
        static::deleting(function ($permission) {
            if (!method_exists(config('access.permission'), 'bootSoftDeletes')) {
                $permission->roles()->sync([]);
            }

            return true;
        });
    }
1291770
public function boot()
    {
        $this->app->booting(function () {
            $loader = AliasLoader::getInstance();
            $loader->alias('SessionFallback', SessionFallbackFacade::class);
        });
        $this->publishes([
            __DIR__ . '/config/session_fallback.php' => config_path('session_fallback.php'),
        ]);
    }
199854
public static function boot()
    {
        parent::boot();

        self::creating(function ($user) {
            if (!$user->verify_code) {
                $user->verify_code = self::generateVerifyCode();
            }
        });
    }
527307
public static function boot()
    {
        parent::boot();

        self::creating(function ($user) {
            if (!$user->api_key) {
                $user->api_key = self::generateApiKey();
            }
        });
    }
173733
public function boot()
    {
        $this->initMigrations();
        $this->initPermissions();
        $this->initMiddlewares();
        $this->initDirectives();
        $this->initUserObserver();
        $this->initCommands();
    }
751315
public function boot()
    {
        $this->registerResources();
        $this->registerServiceProviders();
        $this->registerAliases();
        $this->registerModuleRegistry();
        $this->registerCommands();
        $this->registerRoutesAndMiddlewares();
        $this->registerFields();
        $this->registerGeneratorStubs();
        $this->registerLocales();
        $this->registerViewComposers();
        $this->registerValidationRules();
        $this->registerAssets();

        $this->app->singleton( SecurityStrategy::class, function()
        {
            return $this->app->make( SessionSecurityService::class );
        } );

        $this->loadTranslationsFrom( __DIR__ . '/resources/lang', 'arbory' );
    }
1077511
public function boot()
    {
        $templatePath = config('generators.template_path', $fallbackTemplatePath = __DIR__.'/Stubs').'/';
        
        if (!is_dir($templatePath)) {
            $templatePath = $fallbackTemplatePath . '/';
        }

        $this->publishes([
            __DIR__ . '/Stubs/' => $templatePath
        ], 'stubs');

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

        if (file_exists($configPath)) {
            $this->mergeConfigFrom($configPath, 'generators');
        }

        $this->setStubBasePath($templatePath);   
    }
268008
public function boot()
    {
        $filesystem = $this->app->make('filesystem');

        $filesystem->extend('sftp', function($app, $config) {
            return new Filesystem(new SftpAdapter($config));
        });
    }
955080
public function boot()
    {
        $booter = $this->getBooter();

        if ($response = $booter->boot()) {
            $this->sendResponse($response);
        } else {
            $this->status = self::STATUS_ACTIVE;
        }
    }