'array', ]; public function nextDue(): Attribute { return Attribute::make( get: function () { $cron = new CronExpression($this->schedule); return $cron->getNextRunDate()->format('Y-m-d H:i:s'); } ); } public function cronToHuman(): Attribute { return Attribute::make( get: fn() => CronTranslator::translate($this->schedule) ); } public function className(): Attribute { return Attribute::make( get: fn() => class_basename($this->class) ); } public function user(): BelongsTo { return $this->belongsTo(User::class); } public function logs() { return $this->hasMany(BotLog::class); } public function latestLog() { return $this->hasOne(BotLog::class)->latestOfMany(); } public function failedLogs() { return $this->hasMany(BotLog::class)->where('status', 'failed'); } }