I am developing web base application using Laravel 5.6 . There are many database queries to execute.
As a security purpose I try to store my all queries into a database table as Query log. I have uses AppServiceProvider
service provider to do that. Now I want to disable Query_Log()
function for a while that prevent storing particular database query also.
when I run app with above code, It was running while exceeding database maximum execution time.
Can somebody suggest me how I do that?
public function boot()
{
if(env('App_Debug')){
DB::listen(function($query){
//DB::connection()->disableQueryLog();
Query_Log::insert([
'query_string'=>$query->sql,
'user' => "Admin",
'created_at' =>Carbon::now()->toDateTimeString(),
]);
});
}
}