'datetime', 'is_active' => 'boolean', ]; public function available(): bool { return $this->is_active && $this->used_count < $this->max_uses && (! $this->expires_at || $this->expires_at->isFuture()); } }