livewire / flux

The official Livewire UI component library
https://fluxui.dev
463 stars 38 forks source link

Flux Toast outside a Livewire component not working #566

Closed payrequestio closed 4 days ago

payrequestio commented 1 week ago
livewire/flux                               v1.0.18  The official UI component library for Livewire.
livewire/flux-pro                           1.0.18   The pro version of Flux, the official UI component library for Livewire.
livewire/livewire                           v3.5.12  A front-end framework for Laravel.

I have follow the documentation on: https://fluxui.dev/components/toast Which works if you do it inside a Livewire component, but I want to use it in my app.blade.php or inside a Controller.

Can you give an example how I easily can add Flux::toast('Your changes have been saved.'); to javascript code / a blade page / or controller?

mortenthogersen commented 1 week ago

This works really well: https://github.com/petervandijck/oldschool-fluxtoasts

calebporzio commented 4 days ago

You can use the toasts by manually dispatching events in the browser, but right now I can't support non-Livewire toasts just yet to keep scope limited. Glad there's a workaround out there. Closing this.