Laravel Logo

The other day I had an Eloquent query that wasn’t returning what I expected it to. I started looking for a way to determine what was happening “under the hood” so to speak. It turns out it’s very simple.

// Enable query log

$users = User::where('email', '=', '')->get();

// get the results

This will output something like the following:

array (
  0 => 
  array (
    'query' => 'select * from `users` where `email` = ?',
    'bindings' => 
    array (
      0 => '',
    'time' => 2.75,

Can we all agree dd() is the best thing for quick debugging ever?

Like this post? Don't forget to follow us on Twitter and Facebook for updates.