Level 7
I can't describe more than the doc itself
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
namespace App\Actions;
use Carbon\Carbon; use App\Models\User; use App\Jobs\SendCalendarAlert; use DB;
class SendCalenderAlertAction { public function __invoke(): bool {
$calendar_alert = DB::table('calendar_alerts')
->where('when', '>', now()->subHours(1))
->get();
// dd(now()->subHours());
$alert_data = $calendar_alert->groupBy('calendar_event_id');
dd($alert_data);
if($alert_data){
foreach($alert_data as $alert){
dd($alert);
$data = [
'locale' => 'en', //$alert_data->language,
'to' => '[email protected]', //$alert_data->email,
'name' => 'fahad sheikh' //$alert_data->nick_name
];
}
// queue the email for sending
dispatch(new SendCalendarAlert($data));
return true;
}
return false;
}
}
I am creating every minute cron job for this.
Please help me out of this. I will be thankful for advance
Please or to participate in this conversation.