<?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);
    });
}
