© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
6 replies
Svet

Update a form field when a notification is received from Edit page

Hey all,

I'm trying to update a field in a Filament form when I receive a Laravel notification.

I've setup the listeners and I'm receiving the notification fine, but I'm having trouble understanding how to actually update the field from the Edit page.

I have very little experience with Filament and Livewire, but have been using Laravel for many years.

Currently, I have the following:

// app/Filament/Resources/VideoResource/Pages/EditVideo.php

    protected $listeners = [
        'echo:videos,ScriptGenerated' => 'updateScript',
    ];

    public function updateScript(): void
    {
        $this->form->fill([
            'script' => $this->record->script,
        ]);
    }
// app/Filament/Resources/VideoResource/Pages/EditVideo.php

    protected $listeners = [
        'echo:videos,ScriptGenerated' => 'updateScript',
    ];

    public function updateScript(): void
    {
        $this->form->fill([
            'script' => $this->record->script,
        ]);
    }


This kinda works, but it also overwrites all the other fields in the form, which is not what I want. I'm not exactly sure what to ask here, because I'm not entirely certain if what I'm doing is wrong or not. I see there is a
$this->form->getLivewire()
$this->form->getLivewire()
method and I can change the properties directly from there, but I'm certain this isn't how it's supposed to be done heh.

I read the Livewire and Filament documentation on events and notifications, but this is where I got stuck. Google and chatgpt were of no help.

Any help appreciated!
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Update form field from page action
FilamentFFilament / ❓┊help
3y ago
How to update form field from resource Edit page's method?
FilamentFFilament / ❓┊help
3y ago
Show Filament notification when database notification is received
FilamentFFilament / ❓┊help
2y ago
Refresh a table when notification received
FilamentFFilament / ❓┊help
3y ago