Skip to content
Discussion options

You must be logged in to vote

You should be able to do the following:

public function fieldsForPreview(NovaRequest $request)
{
    return [
        $this->mergeWhen($this->gifts->count() > 0, function () {
            return [
                Heading::make(Str::upper(__('labels.gift'))),
            ];
        }),
    ];
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by crynobone
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4921 on October 15, 2022 03:00.