It's really hard to guess based on that tiny bit of code. Does the session work in other places? What session driver are you using in production? Did you try changing it?
Apr 17, 2022
5
Level 2
Auth::user() return null on livewire
I'm working on multi-step form and when I try to submit the form the Auth::user() returns null. I only encountered this problem when I deployed my application on my server
$rdv = Appointment::create([
'code' => (string) Str::uuid(),
'centres' => $this->centres,
'date' => $this->date_rdv,
'heure' => $this->heure_rdv,
'status' => "Pending",
'client_id' => Auth::id(),
'appointment_type_id' => 1
]);
Please or to participate in this conversation.