© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•11mo ago•
41 replies
j0ej0ej0e

$livewire->form->fill() doesn't work when using slideOver()

I've been following Kevin McKee's excellent "Rapid Laravel Apps with Filament" Laracast but run into an issue when trying to use a factory to fill a form (for testing purposes).

When my resource ("Campaign") has a dedicated CreateCampaign route/page, I'm able to add an action to the form as follows:

Actions::make([
                    Action::make('star')
                        ->label('Insert test data')
                        ->icon('heroicon-m-pencil-square')
                        ->visible(function (string $operation) {
                            return $operation === 'create' && app()->environment('local');
                        })
                        ->action(function (Livewire $livewire) {
                            $data = Campaign::factory()->make()->toArray();
                            $livewire->form->fill($data);
                        }),
                    ])
Actions::make([
                    Action::make('star')
                        ->label('Insert test data')
                        ->icon('heroicon-m-pencil-square')
                        ->visible(function (string $operation) {
                            return $operation === 'create' && app()->environment('local');
                        })
                        ->action(function (Livewire $livewire) {
                            $data = Campaign::factory()->make()->toArray();
                            $livewire->form->fill($data);
                        }),
                    ])


and this works great. However, I'd prefer to use the slideOver() so I comment out
'create' => Pages\CreateCampaign::route('/create'),
'create' => Pages\CreateCampaign::route('/create'),
in the
getPages()
getPages()
function of the campaign resource and add
->slideOver()
->slideOver()
to the
getHeaderActions
getHeaderActions
of the
ListCampaigns
ListCampaigns
file (no other changes made).

I then get the following error:

Filament\Resources\Pages\ListRecords::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /Users/joe/Projects/test_system/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php on line 56

It looks like, when using a slideOver, $livewire is the ListCampaign component rather than the CreateCampaign page so the form is not accessible through $livewire->form. I'm sure there is an easy workaround but I'm pretty new to all this. Thanks 🙂
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

Using slideOver() inside Livewire Component
FilamentFFilament / ❓┊help
11mo ago
Can't `$this->form->fill()` images in custom Livewire Page while using Repeater
FilamentFFilament / ❓┊help
3y ago
Using Step Form with Livewire
FilamentFFilament / ❓┊help
2y ago
Using Livewire inside a form
FilamentFFilament / ❓┊help
2y ago