Open vtalbot opened 3 years ago
Good suggestion. I think we could accomplish this using differently-named "bags", similar to error bags. I could envision allowing a user to pass in a bag name to the Livewire component, with a fallback to the default:
<livewire:flash-container bag="secondary"> <!-- would give the user any flash notifications in the 'secondary' bag -->
<livewire:flash-container> <!-- would give the user any flash notifications in the 'default' bag -->
<livewire:flash-container bag="default"> <!-- would give the user any flash notifications in the 'default' bag -->
API could be:
flash('message')->info()->livewire($this); // default bag
flash('message')->info()->bag('secondary')->livewire($this); // 'secondary' bag
I'll chew on this a bit more but this seems pretty attainable at first ponder. Feel free to PR it! 😉
Hi, nice package!
I think there should be a group property to allow different flash messages at different places.