Sending Notifications On a Filament Page
Hello Everyone,
I am in the admin panel trying to send a notification, I saw someone else do this on github
This is a method I trigger from the form, tough when I open my console I see the following Error:
Any Ideas on how to fix this ?
- The page has multiple forms and multiple form actions
17 Replies
My guess is now that I have to make a seperate component for every form section I am using on the Page to fix this ?
Update: I cannot reproduce it. Yet I has the notification prompt twice. Until the issue came back. Is this normal behaviour. Or should I try recreating the project to see if the installation (reverted trough git) of Notifications broke them
Double notifications shouldn't be normal, no 😅
What's the View for your Page?
Sorry, I was trying to clarify that I tried both ways. Since you told me I may have to include the component in the other thread
This is my View, I used
to create the View and the page
I added HasForms and InteractsWithForms to the generated class
Thanks a lot for your response!
I think a Page already "HasForms". You don't need to implement that
Oh. Thank you!
I’ll correct that once I fed the people here
I guess the next step is to see if something gitignored changed when I installed the Notification package.
I’ll see if it persists if I scaffold a new project with just this page
Allright, no idea what. Since I literally ran but when I test above code in a fresh scaffold it works as described in the docs. Sorry for once again taking your time!
Thanks a lot for your response and your help! I hope to be able to give back to this awesome project soon!
Argh... Hahahahaha, I remade the whole thing. To get the same error XD apparently I got 'lucky'? on the try I had
If anyone comes across this thread and knows how I could fix these ❤️
Another step,
In another project (Jetstream instead of breeze) everything shows. Yet console shows the same errors
Usually this is caused by a script ordering issue
I tried it in a fresh project, an exisiting one, and so on
unfortunately all of them had the issue
Yep, sometimes you need to move it. I had it once on my jetstream project and it was caused by the wirecall being outside of the rendering
Weird thing is, today I once again bit the apple and remade it all
I have no issues now
As I said in the general chat, once I caught up on some work Ill try to recreate it, and pinpoint the exact problem and/or mistake I made and share it 😄
Typically this happens as a result of dom diffing. That’s where I’d start looking to debug.
Thanks @awcodes !
I just found out this problem still occurs once I fill the form with information
I added
And now I get the issue again
I am guessing this is because I am using multiple forms, and I have to fill it when that specific form is mounted
IT works as expected 100% by the way, the console just spews out warnings
Are you doing the multiple forms this way https://filamentphp.com/docs/2.x/forms/getting-started#using-multiple-forms
Filament
Getting started - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Yes
Ok. Yea. Seen this error before and it was a dom diffing issue with modals. It’s like it looses track of the modal container. But it’s reestablished when it’s called on again.
Yeah it seems to get confused, since the fill method happens to the form on the mount function of the Page
In god forbid me to name them frameworks I have seen 'afterMount()' methods to resolve somethign like this
Since, honestly everythign works now, as expected. the console is just blood red
----
I thought this issue had to do with the notifications, yet it's just because I had put the vertical alignment to 'bottom-right' which makes them not show up
Got a solution if anyone is keeping up with this, I checked the code from filament breezy, thumbs up! if i didnt need breeze itself I wouldve installed it 😄
->statePath('userData'),
Adding this to the profileForm fixes the fill