Closed leonardyrj closed 1 year ago
I don't understand what you're asking here—do you want me to add the Authenticate
middleware in this package? Or are you just wondering if you can do it yourself?
if you can add
Okay gotcha. What exactly are you trying to do? Nova handles authentication (whether the user is logged in) for you, and the Authenticate
middleware should already be active on all Nova routes. Check the middleware
array in your nova.php
config file, and if it's not there, you can add it there yourself.
The Authorize
middleware included in this package already let's you use any of Nova/Laravel's authorization (what the user is allowed to do) features.
Let me know if that solves your problem.
I need to get the instance of the authenticated user ex: $request->auth(). When access to your tool returns null
Where exactly are you running $request->user()
? Please include the actual code.
https://nova.laravel.com/docs/4.0/customization/menus.html
$menu->prepend( MenuItem::make( 'My Profile', "/resources/users/{$request->user()->getKey()}" ) );
I'm creating a custom menu, when I access your tool it gives an error in request->user. Test it for you to see the error
That doesn't look like it has anything to do with this package, what makes you think it's related? Can you please share the full output of the error and the complete code sample causing the error?
Pretty sure this isn't an issue with this package, looks similar to #52. Feel free to comment again if you have more information to add or can reproduce/isolate this!
I really liked your package, but I needed to have the Authenticate::class middleware in the request. Is there any problem to include in Route::middleware?
Nova::router(['nova', Authorize::class], 'settings') ->group(__DIR__ . '/../routes/inertia.php');