Support the ongoing development of Laravel.io →
Authentication Testing Laravel
Last updated 2 years ago.
0

Try this:

$user = User::find(Auth::id());

Hope this helps,

Ben

Last updated 5 years ago.
0

Thank you! I have no idea why, but this works. Does anyone know about the "internal" difference between my version $user = User::find(Auth::user()->id); and Bens suggestion $user = User::find(Auth::id()); ?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

M Echelon mechelon Joined 25 Oct 2019

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.