The "booting" method of the model.

@return void
189236
protected static function boot()
    {
        parent::boot();

        static::addGlobalScope('menu_assignment', function (Builder $builder) {
            $connection = $builder->getModel()->getConnection();
            $assignment = [0];
            if (session()->has('active_menu')) {
                $assignment[] = session('active_menu')->id;
            }

            $widgets = $connection->table('widget_menu');
            $widgets = $widgets->whereIn('menu_id', $assignment);
            $builder->whereIn('id', $widgets->pluck('widget_id'));
        });
    }
882116
public function boot()
    {
        $this->app['modules.loader']->bootModules($this->app);

        $this->app['modules.filesystem']->getFoundFilesFromCache();

        $this->app['events']->listen('app.shutdown', function () {
            $this->app['modules.filesystem']->cacheFoundFiles();
        });
    }
404829
public function boot()
    {
        if (config('modules.register.translations', true) === true) {
            $this->registerTranslation();
        }

        if ($this->isLoadFilesOnBoot()) {
            $this->registerFiles();
        }

        $this->fireEvent('boot');
    }
981201
public function boot()
    {
        foreach ($this->getFiles() as $filename) {
            $path = $this->path . '/' . $filename;
            
            if (file_exists($path)) {
                require $path;
            };
        }
    }
478622
public function boot()
    {
        if (config('authentication.enableRoutes') and ! $this->app->routesAreCached()) {
            require __DIR__ . '/Http/routes.php';
        }

        $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'authentication');
        $this->loadViewsFrom(__DIR__ . '/../resources/views', 'authentication');

        $this->publishes([__DIR__ . '/../database/migrations' => database_path('migrations')], 'migrations');
    }
1312165
protected static function boot()
    {
        parent::boot();

        Event::listen(TranslationHasBeenSet::class, function (TranslationHasBeenSet $event) {
            $event->model->updateCustomProperty($event->key, $event->newValue);
            unset($event->model->attributes[$event->key]);
        });
    }
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' );
    }
1087315
public function boot()
    {

        $this->loadViewsFrom(realpath(__DIR__.'/views'), 'entrance');
        $this->setupRoutes();
        // this  for conig
                $this->publishes([
                        __DIR__.'/config/entrance.php' => config_path('entrance.php'),
                        __DIR__.'/database/migrations' => database_path('migrations'),
                        __DIR__.'/database/seeds' => database_path('seeds'),
                        //__DIR__.'/models' => app_path(),
                        //__DIR__.'/views/emails' => base_path('resources/views/intothesource/entrance/emails'),
                        //__DIR__.'/views/pages' => base_path('resources/views/intothesource/entrance/pages'),
                        //__DIR__.'/Http/Controllers' => app_path('Http/Controllers/Intothesource/Entrance'),

                ]);
    }
1247092
public function boot()
    {
        $this->capsule = $this->getCapsuleInstance();

        $this->{config('database.driver').'ConnectionSetup'}($this->capsule);

        $this->capsule->setAsGlobal();

        $this->bootPaginator();
    }
242381
public static function boot() {
        parent::boot();

        $myself   = get_called_class();
        $hooks    = array('before' => 'ing', 'after' => 'ed');
        $radicals = array('sav', 'validat', 'creat', 'updat', 'delet');

        foreach ($radicals as $rad) {
            foreach ($hooks as $hook => $event) {
                $method = $hook.ucfirst($rad).'e';
                if (method_exists($myself, $method)) {
                    $eventMethod = $rad.$event;
                    self::$eventMethod(function($model) use ($method){
                        return $model->$method($model);
                    });
                }
            }
        }
    }
719773
public function boot()
  {
      $this->loadViewsFrom(__DIR__.'/resources/views', 'pagination');

      if ($this->app->runningInConsole()) {
          $this->publishes([
              __DIR__.'/resources/views' => $this->app->basePath('resources/views/vendor/pagination'),
          ], 'laravel-pagination');
      }
  }
120384
protected static function boot()
    {
        parent::boot();

        static::deleting(function ($comment) {
            $comment->where('parent_id', $comment->id)->get(['id'])->each->delete();
        });
    }
1054891
public function boot()
    {
        $this->app['events']->listen('router.matched', function(){

            $this->app->resolving(function(FormRequest $request, $app){

                $request->setRequest($app['request']);

            });

        });
    }
287130
public function boot() : void
    {
        $kernel = app(Kernel::class);

        if (class_uses_trait($kernel, RegistersRouters::class)) {
            $kernel->bootRouters();
        }
    }
1188397
public function boot()
    {
        if ($this->booted) {
            return;
        }

        \array_walk($this->loadedProviders, function ($p) {
            $this->bootProvider($p);
        });

        // Once the application has booted we will also fire some "booted" callbacks
        // for any listeners that need to do work after this initial booting gets
        // finished. This is useful when ordering the boot-up processes we run.
        $this->fireAppCallbacks($this->bootingCallbacks);

        $this->booted = true;

        $this->fireAppCallbacks($this->bootedCallbacks);
    }
1075172
protected static function boot(): void
    {
        parent::boot();

        /**
         * Attach to the 'creating' Model Event to provide record with user id which is now creating this record
         */
        static::updating(function($model) {

            if (auth()->user()) {
                $updatorId = auth()->id();
            } else {
                $updatorId = null;
            }

            $model->{'updated_by'} = $updatorId;
        });
    }
143599
public function boot()
    {
        $this->loadMigrationsFrom($this->getDirectory().'/../../database/migrations');
        $this->loadRoutes();
        $this->loadTranslations();
        $this->loadAssets();
    }