Integration to an existing Laravel application. Call to a member function handle() on null #8299
Replies: 4 comments 1 reply
-
It's likely to be that it cant find the group associated with the user, which is a bit of known issue. I have an open PR that tries to solve this: #5686 Maybe you could trying pulling it in and seeing if it fits your needs? |
Beta Was this translation helpful? Give feedback.
-
Thank you for answering. There is hope, I can see. I am not familiar to operate PR from an external repo (since I have my own repo for that project). If you were kind enough to point me to some instructions, I would appreciate it. |
Beta Was this translation helpful? Give feedback.
-
Thank you! |
Beta Was this translation helpful? Give feedback.
-
I tried the solution you provided with the help of the diff packaged you mentioned. I realize that your pr is for Statamic 3.3. I am with Statamic 4. It seems not to be applied. :-( |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I carefully followed the instructions for installing Statamic in a Laravel application. Everything seems to work fine (after modifying the migration offered by Statamic, which doesn't take into account that the "users" table already exists.)
If I try to connect with the already set login page (not the Statamic one) or if I try to go to the Control Panel section of Statamic trying to log to (/cp), I get the error Call to a member function handle() on null without any further explanation.
I really don't know what to look for...
Note that I'm correctly connected with the Laravel login, but that the error I get on the destination page is with the @can... command (see image). But if I go to /cp, I still get an error with no further details. Should I try to resolve the Policies first?
N.B. I wonder if those permissions are simply not read by Statamic even it is supposed to read the BD table...
The code for the Gates resides in a Middleware
`class AuthGates
{
public function handle($request, Closure $next)
{
$user = auth()->user();
}
`
But more importantly, I do not have access at the /cp even if I remove temporarily the @can command for the main page. The Statamic Control Panel is independant of my application, I presume, and I get the same error...
https://flareapp.io/share/Lm8zGRk7
Beta Was this translation helpful? Give feedback.
All reactions