schema([ Select::make('discount_computation') ->label('Discount computation') ->hiddenLabel() ->options(AdjustmentComputation::class) ->default(AdjustmentComputation::Percentage) ->selectablePlaceholder(false) ->live(), TextInput::make('discount_rate') ->label('Discount rate') ->hiddenLabel() ->live() ->extraInputAttributes(['class' => 'text-right']) ->rate( computation: static fn (Get $get) => $get('discount_computation'), currency: static fn (Get $get) => $get('currency_code'), ), ]); } 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; } }