config('app.alert_logs_period'), ]); if (!$options['alert_logs_names']) { $this->error('['.date('Y-m-d H:i:s').'] No logs to monitor selected'); return; } if (!$options['alert_logs_period']) { $this->error('['.date('Y-m-d H:i:s').'] No logs monitoring period set'); return; } $logs = \App\ActivityLog::whereIn('log_name', $options['alert_logs_names']) ->where('created_at', '>=', \Carbon\Carbon::now()->modify('-1 '.$options['alert_logs_period'])->toDateTimeString()) ->where('created_at', '<', $now->toDateTimeString()) ->get(); if (!count($logs)) { $this->line('['.date('Y-m-d H:i:s').'] No new log records found for the last '.$options['alert_logs_period']); return; } $names = $logs->pluck('log_name')->unique()->toArray(); $text = 'Logs having new records for the last '.$options['alert_logs_period'].':
'.$log->properties.'