The most easy part should be checking on the table and then escape it.
public function boot()
{
DB::listen(
function ($query) {
if (strpos($query->sql, 'querylogtable') !== false ) {
// we don't want to log about the logging
return;
}
QueryLog::create([
'sql' => $query->sql,
'bindings' => implode(', ', $query->bindings),
'time' => $query->time
]);
}
);
}
I have used implode and not a foreach to glue the bindings
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community