original_string: protected function shouldAttributeBeEditableByDefault(ModelAttributeData $attribute, ModelInformationInterface $info)
      {
          // Auto-incrementing key
          if ($attribute->name === $this->model->getKeyName() && $info->incrementing) {
              return false;
          }
  
          // Activatable column is used in listing, so hide in edit form
          if ($info->list->activatable && $info->list->active_column == $attribute->name) {
              return false;
          }
  
          // Orderable column for listify is used in listing, hide in edit form
          if ($info->list->orderable && $info->list->order_column == $attribute->name) {
              return false;
          }
  
          // Automated timestamp columns
          if (    $this->model->timestamps
              &&  (   $attribute->name == $this->model->getCreatedAtColumn()
                  ||  $attribute->name == $this->model->getUpdatedAtColumn()
                  )
          ) {
              return false;
          }
  
          // Exclude paperclip fields other than the main field
          if (    preg_match('#^(?<field>[^_]+)_(file_name|file_size|content_type|updated_at)$#', $attribute->name, $matches)
              &&  array_has($info->attributes, $matches['field'])
          ) {
              return $info->attributes[ $matches['field'] ]->cast !== AttributeCast::PAPERCLIP_ATTACHMENT;
          }
  
          // Any attribute that is a foreign key and should be handled with relation-based strategies
          return ! $this->isAttributeForeignKey($attribute->name, $info);
      }
code: protected function shouldAttributeBeEditableByDefault(ModelAttributeData $attribute, ModelInformationInterface $info)
      {
          // Auto-incrementing key
          if ($attribute->name === $this->model->getKeyName() && $info->incrementing) {
              return false;
          }
  
          // Activatable column is used in listing, so hide in edit form
          if ($info->list->activatable && $info->list->active_column == $attribute->name) {
              return false;
          }
  
          // Orderable column for listify is used in listing, hide in edit form
          if ($info->list->orderable && $info->list->order_column == $attribute->name) {
              return false;
          }
  
          // Automated timestamp columns
          if (    $this->model->timestamps
              &&  (   $attribute->name == $this->model->getCreatedAtColumn()
                  ||  $attribute->name == $this->model->getUpdatedAtColumn()
                  )
          ) {
              return false;
          }
  
          // Exclude paperclip fields other than the main field
          if (    preg_match('#^(?<field>[^_]+)_(file_name|file_size|content_type|updated_at)$#', $attribute->name, $matches)
              &&  array_has($info->attributes, $matches['field'])
          ) {
              return $info->attributes[ $matches['field'] ]->cast !== AttributeCast::PAPERCLIP_ATTACHMENT;
          }
  
          // Any attribute that is a foreign key and should be handled with relation-based strategies
          return ! $this->isAttributeForeignKey($attribute->name, $info);
      }
code_tokens: protected function shouldAttributeBeEditableByDefault ( ModelAttributeData $ attribute , ModelInformationInterface $ info ) { // Auto-incrementing key if ( $ attribute -> name === $ this -> model -> getKeyName ( ) && $ info -> incrementing ) { return false ; } // Activatable column is used in listing, so hide in edit form if ( $ info -> list -> activatable && $ info -> list -> active_column == $ attribute -> name ) { return false ; } // Orderable column for listify is used in listing, hide in edit form if ( $ info -> list -> orderable && $ info -> list -> order_column == $ attribute -> name ) { return false ; } // Automated timestamp columns if ( $ this -> model -> timestamps && ( $ attribute -> name == $ this -> model -> getCreatedAtColumn ( ) || $ attribute -> name == $ this -> model -> getUpdatedAtColumn ( ) ) ) { return false ; } // Exclude paperclip fields other than the main field if ( preg_match ( '#^(?<field>[^_]+)_(file_name|file_size|content_type|updated_at)$#' , $ attribute -> name , $ matches ) && array_has ( $ info -> attributes , $ matches [ 'field' ] ) ) { return $ info -> attributes [ $ matches [ 'field' ] ] -> cast !== AttributeCast :: PAPERCLIP_ATTACHMENT ; } // Any attribute that is a foreign key and should be handled with relation-based strategies return ! $ this -> isAttributeForeignKey ( $ attribute -> name , $ info ) ; }
docstring: Returns whether an attribute should be editable if no user-defined fields are configured.
  
  @param ModelAttributeData                         $attribute
  @param ModelInformationInterface|ModelInformation $info
  @return bool
docstring_tokens: Returns whether an attribute should be editable if no user - defined fields are configured .