/** * Execute the console command. * * @return mixed */ public function handle() { if ($this->option('v')) { $this->line("Cron Version 1.2"); exit; } $now = date('U'); $cronJobs = CronJob::getCronJobsToRun($now); foreach ($cronJobs as $cronJob) { $callable = config('cron.' . $cronJob->key_011); call_user_func($callable); // call to static method $cron = CronExpression::factory($cronJob->cron_expression_011); CronJob::where('id_011', $cronJob->id_011)->update(['last_run_011' => $now, 'next_run_011' => $cron->getNextRunDate()->getTimestamp()]); } }