User::find(pk) searches by primary key. I believe you should use $user=User::where('username',$username)->first();
mnshankar said:
User::find(pk) searches by primary key. I believe you should use $user=User::where('username',$username)->first();
still return NULL
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
What do you get when you dd($username)? Are you sure the username is getting passed to your method?
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
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community