Skip to content

How do i format a relation column and return html? #1919

Closed Answered by HashashinMaster
HashashinMaster asked this question in Q&A
Discussion options

You must be logged in to vote

found it, i just used format method instead of label :

 Column::make("Status", 'stage.name')
                ->sortable()
                ->searchable()
                ->format(
                    function ($value, $row, Column $column) {
                        return Helpers::generateStageBadge($value); // value here is the stage.name
                    }
                )
                ->html(),

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by HashashinMaster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant