Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lenses does not respect hideFromIndex when field is in Stack #6435

Closed
webard opened this issue Jun 22, 2024 · 0 comments
Closed

Lenses does not respect hideFromIndex when field is in Stack #6435

webard opened this issue Jun 22, 2024 · 0 comments

Comments

@webard
Copy link

webard commented Jun 22, 2024

  • Laravel Version: 11.1.11
  • Nova Version: 4.34.3
  • PHP Version: 8.3.8
  • Database Driver & Version: MySQL 8.3.0
  • Operating System and Version: MacOS 14.5 (23F79)
  • Browser type and version: Chrome 126.0.6478.57

Description:

Stack::make('Users', [
    BelongsTo::make('Patron', 'patron', User::class)
           ->hideFromIndex(function ($request, $resource) {
                 return  $resource->type === 'incoming';
        })
   });

When any field is in Stack field in Lenses, hideFromIndex is never called. hideFromIndex works great when there is no Stack, and Stack fields with hideFromIndex works correctly on resource page. Only Lens page has problem.

What I want to do is hide field on index depending on other field value.

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

  1. Create Stack in Lenses
  2. Create Field in Stack
  3. Make hideFromIndex with checking something, or just return true
@laravel laravel locked and limited conversation to collaborators Jun 25, 2024
@crynobone crynobone converted this issue into discussion #6444 Jun 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant