The "booting" method of the model.

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

        //when an item is created
        static::created(function(CartLine $line){
            $cart = $line->getCartInstance() ?: $line->cart;
            $cart->total_price = $cart->total_price + $line->getPrice();
            $cart->item_count = $cart->item_count + $line->quantity;
            $cart->relations = [];
            $cart->save();
        });

        //when an item is updated
        static::updated(function(CartLine $line){
            $cart = $line->getCartInstance() ?: $line->cart;
            $cart->total_price = $cart->total_price - $line->getOriginalPrice() + $line->getPrice();
            $cart->item_count = $cart->item_count - $line->getOriginalQuantity() + $line->quantity;
            $cart->relations = [];
            $cart->save();
        });

        static::deleted(function(CartLine $line){
            $cart = $line->getCartInstance() ?: $line->cart;
            $cart->total_price = $cart->total_price - $line->getPrice();
            $cart->item_count = $cart->item_count - $line->quantity;
            $cart->relations = [];
            $cart->save();
        });
    }
1098785
public function boot()
    {
        $this->publishes(
            [
                $this->getConfigPath() => config_path('vanilla-integration.php'),
            ],
            'config'
        );
        $this->loadRoutesFrom(__DIR__ . '/../../../routes/routes.php');
        $this->registerHelpers();
    }
868352
public function boot()
    {
        $router = $this->app->make(Router::class);
        $events = $this->app->make(Dispatcher::class);
        $kernel = $this->app->make(Kernel::class);

        $this->setExtensionPath();

        $this->registerEventListeners($events);
        $this->registerRouteMiddleware($router, $kernel);
        $this->bootConfiguration();
        $this->bootMemory();
        $this->bootExtensionComponents();
        $this->bootExtensionRouting();
        $this->bootApiRouting($router);
        $this->loadMenuFile();
        $this->loadBreadcrumbsFile();
    }
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);
                    });
                }
            }
        }
    }
853193
public function boot()
    {
        // Loop the providers and register commands
        $providers = $this->container->providers(false);

        foreach ($providers as $provider) {
            if (method_exists($provider, 'commands')) {
                $this->registerCommands($provider->commands());
            }
        }
    }
981201
public function boot()
    {
        foreach ($this->getFiles() as $filename) {
            $path = $this->path . '/' . $filename;
            
            if (file_exists($path)) {
                require $path;
            };
        }
    }
33647
public function boot()
    {
        if ($this->app->runningInConsole()) {
            $config = $this->app->config['eloquent-viewable'];

            $this->publishes([
                __DIR__.'/../config/eloquent-viewable.php' => $this->app->configPath('eloquent-viewable.php'),
            ], 'config');

            if (! class_exists('CreateViewsTable')) {
                $timestamp = date('Y_m_d_His', time());

                $this->publishes([
                    __DIR__.'/../migrations/create_views_table.php.stub' => database_path("/migrations/{$timestamp}_create_views_table.php"),
                ], 'migrations');
            }
        }
    }
1246432
public function boot()
    {
        /*
         * Migrations
         */
        $this->publishes([
            __DIR__ . '/../database/factories' => database_path('factories/'),
        ], $this->package_tag . '-factories');
        $this->publishes([
            __DIR__ . '/../database/migrations' => database_path('migrations/'),
        ], $this->package_tag . '-migrations');
        $this->publishes([
            __DIR__ . '/../database/seeds' => database_path('seeds/'),
        ], $this->package_tag . '-seeds');

        /*
         * Commands
         */
        if ($this->app->runningInConsole()) {
            $this->commands([
                \CleaniqueCoders\Profile\Console\Commands\SeedProfileCommand::class,
            ]);
        }
    }
1094126
public function boot()
	{
		if ($this->booted)
		{
			return;
		}

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

		$this->booted = true;
	}
209387
public function boot()
    {
        parent::boot();

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

        $this->loadRoutes();

        $this->registerErrorHandler();

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

        $this->loadTranslations();
    }
1358246
public function boot()
    {
        if ($this->app instanceof \Laravel\Lumen\Application) {
            $this->bootLumen();
        } else {
            $this->bootLaravel();
        }
    }
143599
public function boot()
    {
        $this->loadMigrationsFrom($this->getDirectory().'/../../database/migrations');
        $this->loadRoutes();
        $this->loadTranslations();
        $this->loadAssets();
    }
947643
public function boot()
    {
        if ($this->booted) return;

        // Register service providers
        foreach ($this['config']->get('app.providers') as $provider) {
            $this->addProvider($provider);
        }

        // Register aliases
        AliasLoader::getInstance($this['config']->get('app.aliases'))->register();

        // Now run boot events on service providers
        array_walk($this->registered, function($p) {
            if (method_exists($p, 'boot')) $p->boot();
        });

        if (file_exists($bootstrap = $this->appPath."/bootstrap/{$this->mode}.php")) {
            require $bootstrap;
        }

        $this->booted = true;
    }
687440
public function boot()
    {
        $this->setupPackage();

        $this->setupBlade($this->app->view);

        $this->setupRoutes($this->app->router);
    }
223826
public function boot()
    {
        if ($this->app->runningInConsole()) {
            $this->publishes([
                __DIR__ . '/../config/config.php' => config_path('wallet.php'),
            ], 'config');

            $this->publishes([
                __DIR__ . '/../resources/migrations/' => database_path('migrations'),
            ], 'migrations');
        }
    }
882398
public function boot()
    {
        $this->app['events']->listen(LocaleUpdated::class, function ($locale) {
            $this->setLocale();
        });

        $this->setLocale();
    }
436613
public function boot()
    {
        foreach($this->providers as $provider => $registered)
        {
            if($registered === false)
                $this->register(new $provider);
        }
    }