Boot the uuid trait for a model.

@return void
429485
protected static function bootAutoUuid()
    {
        static::creating(function ($model) {
            foreach($model->getAutoUuids() as $autoUuid) {
                if (empty($model->{$autoUuid})) {
                    $model->setAttribute($autoUuid, $model->generateUuid()->getBytes());
                }
            }
        });
    }
17868
public function boot()
    {
        $this->loadMigrationsFrom(__DIR__.'/../../migrations');
        $this->publishes(
            [
                __DIR__.'/../../config/passwordless.php' => config_path('passwordless.php'),
                __DIR__.'/../../lang'                    => resource_path('lang/vendor/passwordless'),
            ]
        );
    }
1232969
public function boot()
    {
        $activeTheme = 'avored-default';
        $dbConnectError = false;

        try {
            DB::connection()->getPdo();
        } catch (\Exception $e) {
            $dbConnectError = true;
        }
    
        if (false === $dbConnectError && Schema::hasTable('configurations')) {
            $repository = $this->app->get(ConfigurationInterface::class);
            $activeTheme = $repository->getValueByKey('active_theme_identifier');
        }
        $theme = Theme::get($activeTheme);
        $fallBackPath = base_path('resources/lang');
        $this->app['lang.path'] = array_get($theme, 'lang_path');
    }
31929
public static function bootMutable()
    {
        if (!isset(static::$attributeMutator)) {
            if (function_exists('app') && app()->bound('eloquence.mutator')) {
                static::setAttributeMutator(app('eloquence.mutator'));
            } else {
                static::setAttributeMutator(new Mutator);
            }
        }
        
        $hooks = new Hooks;

        foreach (['setAttribute', 'getAttribute', 'toArray'] as $method) {
            static::hook($method, $hooks->{$method}());
        }
    }
526665
protected static function boot()
    {
        $class = get_called_class();

        static::$mutatorCache[$class] = array();

        foreach (get_class_methods($class) as $method) {
            if (preg_match('/^get(.+)Attribute$/', $method, $matches)) {
                if (static::$snakeAttributes) $matches[1] = Str::snake($matches[1]);

                static::$mutatorCache[$class][] = lcfirst($matches[1]);
            }
        }

        static::bootTraits();
    }
646905
public function boot()
    {
        $db = $this->app['db'];

        $events = $this->app['events'];

        // Setup the ORM Model.
        Model::setConnectionResolver($db);

        Model::setEventDispatcher($events);
    }
1349910
public function boot()
    {
        // Register your migration's publisher
        $this->publishes([
            __DIR__.'/../database/migrations/' => base_path('database/migrations')
        ], 'migrations');
        
        // Publish your config
        $this->publishes([
            __DIR__.'/../config/config.php' => config_path($this->packageName.'.php'),
            __DIR__.'/../config/exampleClass.php' => app_path('Classes/Authorization/AuthorizationClass.php'),
        ], 'config');

        //
    }
727343
public function boot()
    {
        $this->registerMorphs();
        $this->setTablePrefix();
        $this->setUserModel();

        $this->registerAtGate();

        if ($this->runningInConsole()) {
            $this->publishMiddleware();
            $this->publishMigrations();
        }
    }
120384
protected static function boot()
    {
        parent::boot();

        static::deleting(function ($comment) {
            $comment->where('parent_id', $comment->id)->get(['id'])->each->delete();
        });
    }
375714
public function boot()
    {
        if ($this->isLumen() === false) {
            $this->publishes([
                __DIR__ . '/../../config/hashids.php' => config_path('hashids.php'),
            ]);

            // Add 'Assets' facade alias
            AliasLoader::getInstance()->alias('Hashids', 'Torann\Hashids\Facade');
        }
    }
331507
public function boot()
    {
        error_reporting(-1); // E_ALL
        set_exception_handler([$this, 'handleException']);
        set_error_handler([$this, 'handleError']);
        register_shutdown_function([$this, 'handleShutdown']);
        if (config('app.env') != 'testing') {
            ini_set('display_errors', 'Off');
        }
    }
1025157
public static function boot()
    {
        parent::boot();

        // Get the possible class names.
        $class = get_called_class();

        // If the class uses uniqueIds, make sure it is truly unique.
        if (self::testClassForUniqueId($class) == true) {
            $class::creating(function ($object) use ($class) {
                $object->{$object->primaryKey} = $class::findExistingReferences($class, $object->primaryKey);
            });
        }

        // If any fields are marked for unique strings, add them.
        if (count($class::$uniqueStringColumns) > 0) {
            foreach ($class::$uniqueStringColumns as $field) {
                $class::creating(function ($object) use ($class, $field) {
                    $object->{$field} = $class::findExistingReferences($class, $field);
                });
            }
        }

        if (static::$observer != null) {
            $class::observe(new static::$observer);
        }
    }
596490
public static function boot()
    {
        parent::boot();

        // Add functionality for creating a model
        static::creating(function (RestfulModel $model) {
            // If the PK(s) are missing, generate them
            $uuidKeyName = $model->getKeyName();

            if (! is_array($uuidKeyName) && ! array_key_exists($uuidKeyName, $model->getAttributes())) {
                $model->$uuidKeyName = Uuid::uuid4()->toString();
            }
        });

        // Add functionality for updating a model
        static::updating(function (RestfulModel $model) {
            // Disallow updating UUID keys
            if ($model->getAttribute($model->getKeyName()) != $model->getOriginal($model->getKeyName())) {
                throw new BadRequestHttpException('Updating the UUID of a resource is not allowed.');
            }

            // Disallow updating immutable attributes
            if (! empty($model->immutableAttributes)) {
                // For each immutable attribute, check if they have changed
                foreach ($model->immutableAttributes as $attributeName) {
                    if ($model->getOriginal($attributeName) != $model->getAttribute($attributeName)) {
                        throw new BadRequestHttpException('Updating the "'.camel_case($attributeName).'" attribute is not allowed.');
                    }
                }
            }
        });
    }
542435
protected static function boot()
    {
        parent::boot();

        self::creating(function ($model) {
            do {
                $id = mt_rand(pow(10, 9), pow(2, 32) - 1);
            } while (self::find($id));

            $model->{$model->getKeyName()} = $id;
        });
    }
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);
                    });
                }
            }
        }
    }
722135
public function bootstrap()
    {

        // setup autoloader
        require SERVER_AUTOLOADER;

        // make the application available and register the class loaders
        $application = $this->getApplication();
        $application->registerClassLoaders();

        // register the applications annotation registries
        $application->registerAnnotationRegistries();

        // try to load the profile logger
        if (isset($this->loggers[LoggerUtils::PROFILE])) {
            $this->profileLogger = $this->loggers[LoggerUtils::PROFILE];
            $this->profileLogger->appendThreadContext('timer-factory');
        }
    }
1204109
public function bootstrap()
    {

        // setup autoloader
        require SERVER_AUTOLOADER;

        // make the application available and register the class loaders
        $application = $this->application;
        $application->registerClassLoaders();

        // register the applications annotation registries
        $application->registerAnnotationRegistries();

        // add the application instance to the environment
        Environment::singleton()->setAttribute(EnvironmentKeys::APPLICATION, $application);

        // create s simulated request/session ID whereas session equals request ID
        Environment::singleton()->setAttribute(EnvironmentKeys::SESSION_ID, $sessionId = SessionUtils::generateRandomString());
        Environment::singleton()->setAttribute(EnvironmentKeys::REQUEST_ID, $sessionId);

        // try to load the profile logger
        if (isset($this->loggers[$profileLoggerKey = \AppserverIo\Logger\LoggerUtils::PROFILE])) {
            $this->profileLogger = $this->loggers[$profileLoggerKey];
            $this->profileLogger->appendThreadContext('timer-service-executor');
        }
    }