audit_warning_days ?? 0; $today = Carbon::now(); $interval_date = $today->copy()->addDays($interval); $assets = Asset::whereNull('deleted_at')->DueOrOverdueForAudit($settings)->orderBy('assets.next_audit_date', 'desc')->get(); $this->info($assets->count().' assets must be audited in on or before '.$interval_date.' is deadline'); if (($assets) && ($assets->count() > 0) && ($settings->alert_email != '')) { // Send a rollup to the admin, if settings dictate $recipients = collect(explode(',', $settings->alert_email))->map(function ($item) { return new AlertRecipient($item); }); $this->info('Sending Admin SendUpcomingAuditNotification to: '.$settings->alert_email); \Notification::send($recipients, new SendUpcomingAuditNotification($assets, $settings->audit_warning_days)); } } }