original_string: 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;
              }
          });
      }
code: 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;
              }
          });
      }
code_tokens: 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 ; } } ) ; }
docstring: Boot the bootHasKeptFlagBehavior trait for a model.
  
  @return void
docstring_tokens: Boot the bootHasKeptFlagBehavior trait for a model .