Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

papa's avatar
Level 3

Laravel Nova onDelete or Create $request->user() is null

Laravel 7.3 Nova Latest Version

I have configured a custom admin guard and provider

config/auth.php

'guards' => [
    'admin' => [
        'driver' => 'session',
        'provider' => 'admin'
    ]
],


'providers' => [
    'admin' => [
        'driver' => 'eloquent'
        'model' => \App\Modules\Models\Agent\Agent::class
    ]
]

I have configured in config/nova.php the admin guard.

I can login through the web routes of Nova, create Resources and see the data in the tables. The problem is when I send a request to softDelete a record I get 500 error because the $request->user()is null.

The error in logs is: Call to a member function getAuthIdentifier() on null in ActionEvent: 209

Can someone let me know what is wrong and the $request->user() is null? Thanks

0 likes
2 replies
Reppair's avatar

Yeah, am having similar issue. Not really sure why would it be missing for some requests.

Also familiar feeling asking Nova related questions around the community and there is just no answer to them, like testing your Nova back-office for example. I think I often see a huge blue elephant in the room when it comes to Nova. :D

Please or to participate in this conversation.