columnSpan(3); } public function type(DocumentType | string $type): static { if (is_string($type)) { $type = DocumentType::from($type); } $this->documentType = $type; return $this; } public function getType(): DocumentType { return $this->documentType; } public function getTemplate(): Template { $defaults = DocumentDefault::query() ->type($this->documentType) ->first(); return $defaults?->template ?? Template::Default; } }