/** * 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()]); } }
public function updateCustomRecord($parameters) { CronJob::where('id_011', $parameters['id'])->update(['name_011' => $this->request->input('name'), 'package_id_011' => $this->request->input('package'), 'cron_expression_011' => $this->request->input('cronExpression'), 'key_011' => $this->request->input('key'), 'active_011' => $this->request->input('active', 0)]); }