jackson25
help me to make notification for this
$prospects = \App\Models\Prospect::all();
foreach ($prospects as $prospect) {
$relanceDate = \Carbon\Carbon::parse($prospect->relance);
$RDVDate = \Carbon\Carbon::parse($prospect->RDV);
if ($relanceDate->copy()->subDay()->isToday()) {
Notification::make()
->title('Tomorrow is relance with')
->sendToDatabase($recipient);
}
if ($RVDDate->copy()->subDay()->isToday()) {
Notification::make()
->title('Tomorrow is an appointment with')
->sendToDatabase($recipient);
}
}
1 replies