first
This commit is contained in:
18
app/Helpers/helpers.php
Normal file
18
app/Helpers/helpers.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
/**
|
||||
* Log
|
||||
*/
|
||||
function logDB(): void
|
||||
{
|
||||
if (! app()->isLocal()) {
|
||||
return;
|
||||
}
|
||||
|
||||
DB::listen(function ($query) {
|
||||
Log::info($query->sql, $query->bindings, $query->time);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user