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

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

Last updated 2 years ago.
0

Thanks a lot for the solution. I appreciate for your help.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

SzkolaWEB szkolaweb Joined 26 Mar 2014

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.