Support the ongoing development of Laravel.io →
Database Eloquent Views
Last updated 2 years ago.
0

User::find(pk) searches by primary key. I believe you should use $user=User::where('username',$username)->first();

0

mnshankar said:

User::find(pk) searches by primary key. I believe you should use $user=User::where('username',$username)->first();

still return NULL

0

Try this:

$user = User::whereUsername($username)->first();
0

anatoliyarkhipov said:

Try this:

$user = User::whereUsername($username)->first();

still : "Trying to get property of non-object" ... However now I dont get Null when I dumb $user

0

What do you get when you dd($username)? Are you sure the username is getting passed to your method?

0

OK now I get it .. the problem was that I had no profile for the users I try to reach for their account thanks to all

0

Sign in to participate in this thread!

Eventy

Your banner here too?

mamak24 mamak24 Joined 9 Feb 2015

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.