Laravel log both the query *AND* the query result

99 Views Asked by At

Before anyone gets mad, this is a duplicate of this question:

Laravel 5.4: logging SQL queries along with results

But that question was never answered properly, maybe the OP didn't quite phrase the question clearly enough initially.

So, I have Laravel-debugbar: https://github.com/barryvdh/laravel-debugbar

That gets you the sql query, bindings, and time. What it does not give you is what the actual results of the query were.

The same thing is true when you enable query logging in Laravel. You get the query, the bindings, and the time.

What I want are the query, the bindings, the time, and the results of that query. I'd also settle for at least knowing the number of results that are returned from each query.

1

There are 1 best solutions below

0
On

I think you should look into Xdebug maybe ? It’s great for seeing what’s what at each line. In this case the results of a query.