© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago
Orvalo

Events on widget from custom page

Hey,

Is it possible to dispatch an event from a custom page to a widget?

//  /app/Livewire/CustomPage.php

public function getHeaderWidgets(): array
{
  return [
    ExampleOverview::make([
      'foo' => $this->foo ?? [],
    ])
   ];
}

public function refresh(): void {
  $this->foo[] = 0 // New data chart
  $this->dispatch('update-foo');
}
//  /app/Livewire/CustomPage.php

public function getHeaderWidgets(): array
{
  return [
    ExampleOverview::make([
      'foo' => $this->foo ?? [],
    ])
   ];
}

public function refresh(): void {
  $this->foo[] = 0 // New data chart
  $this->dispatch('update-foo');
}


//app/Livewire/ExampleOverview.php

class ExampleOverview extends BaseWidget
{

    public array $foo = [];

    #[On('update-foo')]
    protected function getStats(): array
    {
        return [
            Stat::make('','')
                ->chart($this->foo)
        ];
    }
}
//app/Livewire/ExampleOverview.php

class ExampleOverview extends BaseWidget
{

    public array $foo = [];

    #[On('update-foo')]
    protected function getStats(): array
    {
        return [
            Stat::make('','')
                ->chart($this->foo)
        ];
    }
}
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

Filter Widget Chart from form on custom page
FilamentFFilament / ❓┊help
3mo ago
Dashboard page - custom widget
FilamentFFilament / ❓┊help
3y ago
Pass data to widget from custom page
FilamentFFilament / ❓┊help
2y ago
pass data to widget from custom page
FilamentFFilament / ❓┊help
3y ago