protected function makeModelListColumnDataForAttributeData(ModelAttributeData $attribute, ModelInformationInterface $info)
    {
        $primaryIncrementing = $attribute->name === $this->model->getKeyName() && $info->incrementing;

        $sortable = (
            $attribute->isNumeric()
            ||  in_array($attribute->cast, [
                AttributeCast::BOOLEAN,
                AttributeCast::DATE,
                AttributeCast::STRING,
            ])
            &&  ! in_array($attribute->type, [
                'text', 'longtext', 'mediumtext',
                'blob', 'longblob', 'mediumblob',
            ])
        );

        $sortDirection = 'asc';
        if (    $primaryIncrementing
            ||  in_array($attribute->cast, [ AttributeCast::BOOLEAN, AttributeCast::DATE ])
        ) {
            $sortDirection = 'desc';
        }

        return new ModelListColumnData([
            'source'         => $attribute->name,
            'strategy'       => $this->determineListDisplayStrategyForAttribute($attribute),
            'style'          => $primaryIncrementing ? 'primary-id' : null,
            'editable'       => $attribute->fillable,
            'sortable'       => $sortable,
            'sort_strategy'  => $attribute->translated ? 'translated' : null,
            'sort_direction' => $sortDirection,
        ]);
    }
protected function makeModelListColumnDataForAttributeData(ModelAttributeData $attribute, ModelInformationInterface $info)
    {
        $primaryIncrementing = $attribute->name === $this->model->getKeyName() && $info->incrementing;

        $sortable = (
            $attribute->isNumeric()
            ||  in_array($attribute->cast, [
                AttributeCast::BOOLEAN,
                AttributeCast::DATE,
                AttributeCast::STRING,
            ])
            &&  ! in_array($attribute->type, [
                'text', 'longtext', 'mediumtext',
                'blob', 'longblob', 'mediumblob',
            ])
        );

        $sortDirection = 'asc';
        if (    $primaryIncrementing
            ||  in_array($attribute->cast, [ AttributeCast::BOOLEAN, AttributeCast::DATE ])
        ) {
            $sortDirection = 'desc';
        }

        return new ModelListColumnData([
            'source'         => $attribute->name,
            'strategy'       => $this->determineListDisplayStrategyForAttribute($attribute),
            'style'          => $primaryIncrementing ? 'primary-id' : null,
            'editable'       => $attribute->fillable,
            'sortable'       => $sortable,
            'sort_strategy'  => $attribute->translated ? 'translated' : null,
            'sort_direction' => $sortDirection,
        ]);
    }
protected function makeModelListColumnDataForAttributeData ( ModelAttributeData $ attribute , ModelInformationInterface $ info ) { $ primaryIncrementing = $ attribute -> name === $ this -> model -> getKeyName ( ) && $ info -> incrementing ; $ sortable = ( $ attribute -> isNumeric ( ) || in_array ( $ attribute -> cast , [ AttributeCast :: BOOLEAN , AttributeCast :: DATE , AttributeCast :: STRING , ] ) && ! in_array ( $ attribute -> type , [ 'text' , 'longtext' , 'mediumtext' , 'blob' , 'longblob' , 'mediumblob' , ] ) ) ; $ sortDirection = 'asc' ; if ( $ primaryIncrementing || in_array ( $ attribute -> cast , [ AttributeCast :: BOOLEAN , AttributeCast :: DATE ] ) ) { $ sortDirection = 'desc' ; } return new ModelListColumnData ( [ 'source' => $ attribute -> name , 'strategy' => $ this -> determineListDisplayStrategyForAttribute ( $ attribute ) , 'style' => $ primaryIncrementing ? 'primary-id' : null , 'editable' => $ attribute -> fillable , 'sortable' => $ sortable , 'sort_strategy' => $ attribute -> translated ? 'translated' : null , 'sort_direction' => $ sortDirection , ] ) ; }
Makes data set for list column given attribute data.

@param ModelAttributeData                         $attribute
@param ModelInformationInterface|ModelInformation $info
@return ModelListColumnData
Makes data set for list column given attribute data .