Comments (5)
Finally figured it out - $request->user()
returns the user using the default guard defined in config/auth.php
. In my case Nova is not using the default guard thus null was being returned.
To solve this specify the guard used by Nova: $request->user('guard-name')
.
from nova-settings-tool.
I can't reproduce this, are you absolutely sure the can()
function that's returning null is that one, in that exact spot? What is the entire stack trace of the error you're getting?
from nova-settings-tool.
Here is the full stack trace: https://flareapp.io/share/x7Xk2vOP#F66
The error is occurring with no other nova packages/tools so I can't figure out what else it would be.
from nova-settings-tool.
Can you create a repo with a reproduction of that error? The code you shared in this issue works in a new app.
In that stack trace I can see that the error is happening at the /nova/settings
URL but the canSee()
and authorizedToSee()
methods in the stack trace are part of Nova itself, I'm not overriding them.
Is your app doing anything that would change the behaviour of $request->user()
? Is your Nova installation using any kind of custom auth stuff? What does your permissions.admin
Gate actually look like?
from nova-settings-tool.
Indeed the gate is weird, can confirm $request->user() is null for canSee(), in my case im using different guards for the nova panel, so might be the issue.
from nova-settings-tool.
Related Issues (20)
- Authorization HOT 1
- Textarea type not working HOT 4
- How to get the values? HOT 1
- Support for standard Nova fields HOT 5
- How can "toggle" be set to true as default? HOT 6
- Single file input HOT 2
- Error After Installing HOT 4
- settings input of type number are not working HOT 3
- Error after installation (Call to a member function authorize() on string) HOT 2
- Frontend string translations HOT 3
- Hide from navigation HOT 7
- Can't add logs on change settings HOT 1
- Fields are not added to the admin panel. HOT 7
- Not compatible with Nova 4.0 HOT 5
- Do this module support settings per user? HOT 2
- Resource page does not show after visit setting page HOT 2
- TypeError: Cannot read properties of null (reading 'split') HOT 6
- Show/hide fields based on permissions? HOT 1
- Insert middleware Authenticate::class HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nova-settings-tool.