- 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