-2

I Tried retrieving my data from $result via:

$result->pluck('request_time');

and

$result->request_time;

Both give me a non-object error, var_dump returns:

array (size=1)
  0 => 
  object(stdClass)[167]
  public 'id' => string 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' (length=38)
  public 'request_time' => string '2015-05-10 17:01:02' (length=19)
  public 'account_id' => int XXXXXXX
  public 'NOW()' => string '2015-05-14 02:03:12' (length=19)

How do I retrieve the data without using the DB::table->pluck method?

Larry Mckuydee
  • 473
  • 2
  • 6
  • 10

2 Answers2

0

It's giving you a non-object error because $result is an array.

Try $result[0]->request_time;

user1669496
  • 32,176
  • 9
  • 73
  • 65
0

Try

$result = DB::table('yourtable')->where('foo', 'bar')->first();
dd($result->request_time);
Ezequiel Moreno
  • 2,228
  • 22
  • 27