I have a phpunit test that does some query stuff and then:
$results = $thingy::where("finder_id", "=", "37");
$queries = DB::getQueryLog();
dd($queries);
but $queries always returns an empty array
Config::get('app.debug') is true.
I have tried:
DB::enableQueryLog()
DB::connection()->enableQueryLog()
with no luck. I have also tried various event listeners like:
Event::listen("illuminate.query", function($query, $bindings, $time, $name){
\Log::sql($query."\n");
\Log::sql(json_encode($bindings)."\n");
});
What else could be causing this?
EDIT: To eliminate PHPUnit as the cause, I setup a test route with a known working model
Route::get('fndr',function() {
$customer = new Customer;
$results = $customer->first();
var_dump($results->NAME);
$queries = DB::getQueryLog();
dd($queries);
});
Still $queries is empty.