© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•10mo ago•
12 replies
Marek

Filling data in custom forms on a custom page does not work

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,
            ])
        ;
    }
}
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
$this->record
is populated, if I do
dd($form)
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?
Solution
Hmm. All that looks ok. But you’re missing the statePath() on each form. Make sure you haven’t missed any of the steps here: https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component#using-multiple-forms
Adding a form to a Livewire component - Forms - Filament
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Modal does not work in a Custom Page
FilamentFFilament / ❓┊help
3y ago
Multiple forms on custom page
FilamentFFilament / ❓┊help
3y ago
Multiple forms in custom page
FilamentFFilament / ❓┊help
3y ago
Custom Page Forms Function Didn't Work
FilamentFFilament / ❓┊help
3y ago