Skip to content

Stack field not caring about its fields showOnIndex callbacks #6942

@andypooletrioteca

Description

@andypooletrioteca
  • Laravel Version: 12
  • Nova Version: 5.7.6

Description:

The stack fields are not taking care of the results of the callbacks defined in their fields showOnIndex. It only works with showOnDetail callbacks

Detailed steps to reproduce the issue on a fresh Nova installation:

Create a stack field like this:

Stack::make('Things', [
    Line::make('First thing', fn($resource) => 'hello')
        ->showOnIndex(false)
        ->showOnDetail(true),
]),

The line will be always shown, both on the index and detail pages.

If we otherwise set showOnDetail(false) it won't be shown neither on index nor on detail pages.

Added to this, if no fields are shown, the stack field is still displayed without any value. Guess it would be better to hide it in this scenario

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions