I am trying to send mail to user. I don't know why its shows error.
$unUsedModuleIds=!$modulesIds->whereIn('id',$usedModuleIds)->exists();
when add this statement it's showing error.
foreach ($ModuleAutoMail as $module) {
if ($mail->condition_id == '3') {
$last_used_module = Carbon::parse($module->last_used_module);
$DeferenceInDays = Carbon::parse(Carbon::now())->diffInDays($last_used_module);
$usedModuleIds = module_auto_mail::where('user_id', $user_id)->pluck('module_id');
$unUsedModuleIds = !$modulesIds->whereIn('id', $usedModuleIds)->exists();
if ($unUsedModuleIds) {
$ableToSendMail = true;
}
if ($DeferenceInDays > 7) {
$ableToSendMail = false;
}
}
}
$modulesIds
? – Lizesh Shakya