public static function bootHasKeptFlagBehavior(): void
    {
        static::creating(function ($entity) {
            if (!$entity->is_kept) {
                $entity->is_kept = false;
            }
        });

        static::updating(function ($entity) {
            if (!$entity->is_kept && $entity->setKeptOnUpdate) {
                $entity->is_kept = true;
            }
        });
    }
public static function bootHasKeptFlagBehavior(): void
    {
        static::creating(function ($entity) {
            if (!$entity->is_kept) {
                $entity->is_kept = false;
            }
        });

        static::updating(function ($entity) {
            if (!$entity->is_kept && $entity->setKeptOnUpdate) {
                $entity->is_kept = true;
            }
        });
    }
public static function bootHasKeptFlagBehavior ( ) : void { static :: creating ( function ( $ entity ) { if ( ! $ entity -> is_kept ) { $ entity -> is_kept = false ; } } ) ; static :: updating ( function ( $ entity ) { if ( ! $ entity -> is_kept && $ entity -> setKeptOnUpdate ) { $ entity -> is_kept = true ; } } ) ; }
Boot the bootHasKeptFlagBehavior trait for a model.

@return void
Boot the bootHasKeptFlagBehavior trait for a model .