F
Filament3mo ago
Jefry

is it possible to create a notification in alpinejs without it going to the server?

<div class="background-light900_dark200 relative max-w-4xl overflow-hidden rounded-xl border border-gray-200 px-5 py-10 shadow-sm dark:border-none" x-data="{ vote(type) { if (!$wire.userId) { return new FilamentNotification() .title('Please sign in') .body('You need to sign in to vote') .icon('heroicon-o-exclamation-circle') .iconColor('warning') .send() } // vote logic here } }">
3 Replies
toeknee
toeknee3mo ago
Yup new FilamentNotification() .title('Saved successfully') .send()
toeknee
toeknee3mo ago
So similar to what you had, but you just send it on whatever it is you are doing, otherwise if the server needs to receive a response to action something, you just send it as normal.
Want results from more Discord servers?
Add your server