<?php
namespace App\Providers;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
if (env('DB_LOGQUERIES')) {
DB::listen(function ($query) {
Log::info('Query executed: ' . $query->sql, ['bindings' => $query->bindings]);
});
}
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter