The selected {field} is invalid?

I keep getting this error saying that the selected fields are invalid whenever I try to submit this form. The form is located within a custom page.

This is part of my form, but the rest of it is similar/the same:
    public Defaults $defaultSetting;

    public $account_id = '';
    public $currency_code = '';
    public $sales_tax_id = '';
    public $purchase_tax_id = '';
    public $income_category_id = '';
    public $expense_category_id = '';

    public function mount():void
    {
        $this->form->fill();
    }

    protected function getFormSchema(): array
    {
        return [
            Section::make('General')
                ->schema([
                    Select::make('account_id')
                        ->label('Account')
                        ->relationship('account', 'name', static fn ($query) => $query->where('company_id', Auth::user()->currentCompany->id))
                        ->searchable()
                        ->default(Defaults::getDefaultAccount())
                        ->required(),
                    Select::make('currency_code')
                        ->label('Currency')
                        ->relationship('currency', 'code', static fn ($query) => $query->where('company_id', Auth::user()->currentCompany->id))
                        ->searchable()
                        ->default(Defaults::getDefaultCurrency())
                        ->required(),
                ])->columns(),
        ];
    }

    protected function getFormModel(): string
    {
        return Defaults::class;
    }

    public function create(): void
    {
        $defaultSetting = Defaults::create($this->form->getState());

        $this->form->model($defaultSetting)->saveRelationships();
    }

    public function render(): View
    {
        return view('livewire.default-setting');
    }
}
Screenshot_2023-07-04_015548.png
Was this page helpful?