I am trying to have two forms on a custom page for a resource. Neither of forms is attached to the model.
I am unable to populate the form with data. It just doesn't do anything. Here's what I've done:
class TakePaymentPage extends Page
{
// ...
protected function getForms(): array
{
return [
'manualPaymentForm',
'stripePaymentForm',
];
}
public function manualPaymentForm(Form $form): Form
{
return $form
->schema([
Section::make('Manual Payment')
->columns(2)
->schema([
TextInput::make('customer_name')
->label('Customer'),
TextInput::make('customer_email')
->label('Email'),
TextInput::make('reference'),
]),
])
->fill([
'customer_name' => $this->record->customer->fullName(),
'customer_email' => $this->record->customer->email,
])
;
}
}
I've checked, when method is executed, $this->record is populated, if I do dd($form) in that method, it seems form has the details.
But when page is rendered, the details are not populated.
What am I doing wrong?