protected function shouldAttributeBeDisplayedByDefault(ModelAttributeData $attribute, ModelInformationInterface $info)
    {
        if (in_array($attribute->type, [
            'text', 'longtext', 'mediumtext',
            'blob', 'longblob', 'mediumblob',
        ])) {
            return false;
        }

        // Hide active column if the model if activatable
        if ($info->list->activatable && $info->list->active_column == $attribute->name) {
            return false;
        }

        // Hide orderable position column if the model if orderable
        if ($info->list->orderable && $info->list->order_column == $attribute->name) {
            return false;
        }

        // Hide 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);
    }
protected function shouldAttributeBeDisplayedByDefault(ModelAttributeData $attribute, ModelInformationInterface $info)
    {
        if (in_array($attribute->type, [
            'text', 'longtext', 'mediumtext',
            'blob', 'longblob', 'mediumblob',
        ])) {
            return false;
        }

        // Hide active column if the model if activatable
        if ($info->list->activatable && $info->list->active_column == $attribute->name) {
            return false;
        }

        // Hide orderable position column if the model if orderable
        if ($info->list->orderable && $info->list->order_column == $attribute->name) {
            return false;
        }

        // Hide 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);
    }
protected function shouldAttributeBeDisplayedByDefault ( ModelAttributeData $ attribute , ModelInformationInterface $ info ) { if ( in_array ( $ attribute -> type , [ 'text' , 'longtext' , 'mediumtext' , 'blob' , 'longblob' , 'mediumblob' , ] ) ) { return false ; } // Hide active column if the model if activatable if ( $ info -> list -> activatable && $ info -> list -> active_column == $ attribute -> name ) { return false ; } // Hide orderable position column if the model if orderable if ( $ info -> list -> orderable && $ info -> list -> order_column == $ attribute -> name ) { return false ; } // Hide 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 ) ; }
Returns whether an attribute should be displayed if no user-defined list columns are configured.

@param ModelAttributeData                         $attribute
@param ModelInformationInterface|ModelInformation $info
@return bool
Returns whether an attribute should be displayed if no user - defined list columns are configured .