Korferer Posted January 2, 2015 Share Posted January 2, 2015 Hi, This code works (and correctly shows just one result in my view); $people = DB::table('people')->where('id', '=', $person_id)->get(); But this one doesn't; $people = DB::table('people')->where('id', $person_id)->first(); And produces the error; Trying to get property of non-object (View: /media/sf_sandbox/health/app/views/agreement/display.blade.php) The `people` table just has a few fields of information on the individual with a primary key called `id`. I followed the Laravel guide on select statements. I don't understand what the error is trying to tell me and I don't get why that second statement is wrong. What's so wrong about it? I just want to understand Laravel/Objects better.... Thanks Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.