Skip to content
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

availableForNavigation() still returning TRUE #2544

Closed
issour opened this issue Apr 24, 2020 · 5 comments
Closed

availableForNavigation() still returning TRUE #2544

issour opened this issue Apr 24, 2020 · 5 comments

Comments

@issour
Copy link

issour commented Apr 24, 2020

  • Laravel Version: 7.7.1
  • Nova Version: 3.4.1
  • PHP Version: 7.4.4

Description:

Hi !
The resource remains visible on the navigation even if the function returns false

public static function availableForNavigation(Request $request) { return $request->user()->isAdmin(); }

Steps To Reproduce:

copy and paste this function in resource post : Posts stills visible. even returning false manually

public static function availableForNavigation(Request $request) { return $request->user()->isAdmin(); }
Thx !!!

@wfeller
Copy link

wfeller commented Apr 24, 2020

It looks like the static property is used rather than the method in ResourceManager : https://github.com/laravel/nova/blob/c14a97d3ca9404951a1e69a5300c8f5cc0c70333/src/Tools/ResourceManager.php#L36

Should be return $resource::availableForNavigation($request); rather than return $resource::$displayInNavigation;

@mathd
Copy link

mathd commented Apr 24, 2020

I have the same issue with Nova version 3.4.1, the workaroud for the moment is to downgrade to 3.4.0

@issour
Copy link
Author

issour commented Apr 25, 2020

@mathd yes! that the solution for the moment :)

@issour
Copy link
Author

issour commented Apr 27, 2020

hi @davidhemphill Can you please explain this issue ?
Many thx

@francauxach
Copy link

@issour Yeah, fixed in v3.5.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants