Проверьте, имеет ли столб
->where(function ($query) {
$query->whereNull('exam_ends_at')
->orWhere('exam_ends_at', '>', Carbon::now());
})
Lokesh003Coding
->where(function ($query) {
$query->whereNull('exam_ends_at')
->orWhere('exam_ends_at', '>', Carbon::now());
})
//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 . '%');
});