Instead of using ->get();
$user = User::where('username' , '=', $username)->get();
try using ->first();
$user = User::where('username' , '=', $username)->first();
I believe you're storing a collection into $user using ->get(), you'll have to foreach the $user variable to access the data if you use get().
Hopefully that helps
Thanks a lot for the solution. I appreciate for your help.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community