mercredi 21 octobre 2015

Trying to get the "first name" of the loggedin user results in Error: Trying to get property of non-object

I'm trying to make a favorite function, however I always get the same error and I don't understand why or how and I can fix it.

I want to get the loggedin user's first name, this is how I try to access it:

echo Auth::user()->first_name;

But I always get this error:

ErrorException

Trying to get property of non-object

this is what my DB users looks like: enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire