'datetime', 'next_run_client' => 'datetime', 'created_at' => 'timestamp', 'updated_at' => 'timestamp', 'deleted_at' => 'timestamp', 'is_paused' => 'boolean', 'is_deleted' => 'boolean', 'parameters' => 'array', ]; protected $appends = [ 'hashed_id', ]; /** * Service entry points. */ public function service(): SchedulerService { return new SchedulerService($this); } public function company() { return $this->belongsTo(Company::class); } /** * remainingCycles * * @return int */ public function remainingCycles() : int { if ($this->remaining_cycles == 0) { return 0; } elseif ($this->remaining_cycles == -1) { return -1; } else { return $this->remaining_cycles - 1; } } }