subHours(setting('acars.live_time')); $pireps = Pirep::where('updated_at', '<', $date) ->where('state', PirepState::IN_PROGRESS) ->where('status', '<>', PirepStatus::PAUSED) ->get(); foreach ($pireps as $pirep) { event(new PirepCancelled($pirep)); Log::info('Cron: Deleting Expired Live PIREP id='.$pirep->id.', state='.PirepState::label($pirep->state)); $pirep->delete(); } } }