//by this we can create filter with "And" condition when value exists
$query->when($what,function($q,$what){
$q->where('log_event_description', 'like', '%' . $what . '%');
})->when($detail,function($q,$detail){
$q->where('log_details', 'like', '%' . $detail . '%');
})->when($who,function($q,$who){
$q->where('log_event_type', 'like', '%' . $who . '%');
})->when($when,function($q,$when){
$q->where('created_at', 'like', '%' . $when . '%');
});