Reputation: 10896
In my api I say this:
public function internInfo($id)
{
$user = User::where('EmployeeId','=',$id);
dd($user->LastName);
}
The user is found but it can't get the LastName, but LastName exist!
What am I doing wrong?
Upvotes: 1
Views: 15
Reputation: 25435
You forgot to take the results...Should be:
$user = User::where('EmployeeId','=',$id)->first();
Upvotes: 2