schema([ TextInput::make('address_line_1') ->label('Address Line 1') ->required() ->maxLength(255), TextInput::make('address_line_2') ->label('Address Line 2') ->maxLength(255), CountrySelect::make('country') ->clearStateField() ->required(), StateSelect::make('state_id'), TextInput::make('city') ->label('City') ->required() ->maxLength(255), TextInput::make('postal_code') ->label('Postal Code / Zip Code') ->maxLength(255), ]); } public function softRequired(bool $condition = true): static { $this->setSoftRequired($condition); return $this; } protected function setSoftRequired(bool $condition): void { $this->isSoftRequired = $condition; $childComponents = $this->getChildComponents(); foreach ($childComponents as $component) { if ($component instanceof Field && $component->isRequired()) { $component->markAsRequired(! $condition); } } } }