'boolean', 'snooze_until' => 'datetime', 'done_at' => 'datetime', ]; /** Tareas "activas": no hechas y no snoozed. */ public function scopeActive(Builder $q): Builder { return $q->where('done', false) ->where(function ($q2) { $q2->whereNull('snooze_until') ->orWhere('snooze_until', '<=', now()); }); } public function getNextDueInAttribute(): int { if (! $this->snooze_until || $this->snooze_until->isPast()) { return 0; } return max(0, now()->diffInSeconds($this->snooze_until, false)); } }