'date', 'end_date' => 'date', 'is_active' => 'boolean', 'interval_hours' => 'integer', ]; } public function mailbox(): BelongsTo { return $this->belongsTo(Mailbox::class); } /** * Check if the autoresponder is currently active based on dates. */ public function isCurrentlyActive(): bool { if (!$this->is_active) { return false; } $now = now()->startOfDay(); if ($this->start_date && $now->lt($this->start_date)) { return false; } if ($this->end_date && $now->gt($this->end_date)) { return false; } return true; } /** * Get the email address for this autoresponder. */ public function getEmailAttribute(): string { return $this->mailbox?->email ?? ''; } }