Skip to content

Commit 64335e4

Browse files
authored
Bugfix: request()->user() in displayInNavigation is null (#105)
Bugfix for issue #104. Allow the use of policy in displayInNavigation by deferring display check to render time when currently logged in user is available.
1 parent 263658a commit 64335e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Arbitrator.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ public function findOrFail(string $key): Resource
123123
*/
124124
private function registerMenu(Resource $resource, int $key): Arbitrator
125125
{
126-
if (! $resource::displayInNavigation()) {
127-
return $this;
128-
}
129-
130126
View::composer('platform::dashboard', function () use ($resource, $key) {
127+
if (! $resource::displayInNavigation()) {
128+
return;
129+
}
130+
131131
$title = Menu::make()
132132
->canSee($key === 0)
133133
->title(__('Resources'))

0 commit comments

Comments
 (0)