Closed Bryan-Lund closed 2 years ago
I tried restricting the users that could see the settings by what was in the readme, but it didn't work. I.e. this bit:
public function tools(): array { return [ NovaSettings::make()->canSee(fn () => user()->isAdmin()), ]; }
I had to put Auth:: in front of the user() like so to get it working. Unless i'm missing something, this should be updated:
Auth::
user()
public function tools(): array { return [ NovaSettings::make()->canSee(fn () => Auth::user()->isAdmin()), ]; }
it's general example, doesn't mean you gonna take all of an example
You can create a helper function user() { return Auth::user(); }. 😉
function user() { return Auth::user(); }
I tried restricting the users that could see the settings by what was in the readme, but it didn't work. I.e. this bit:
I had to put
Auth::
in front of theuser()
like so to get it working. Unless i'm missing something, this should be updated: