Notification error , Undefined array key
Hello! I am making a notification but my domain_check_id is undefined array key, Anyone has a idea how to fix this i don't understand what is miss with it.
Solution:Jump to solution
i fixed it 😄 it was a stupid fault of me . I forgot to delete some old records i thought i did . Now it does the job just needed to edit the code for the id , It look like this now 😄
```
public function __construct(public User $user, public DomainCheck $domainCheck, public string $message, public string $categories)
{...
17 Replies
Check the
toFilamentNotification()
method. You are using some undefined variables.
And probably want to use $this->...
i thought everything was right about this code. I couldn't find the missing piece. I am doing the same for the user as you can see in the code and that is working fine
Oh didn't see that you are destructuring. Is
domain_check_id
a Field with a relationship? That isn't included in $data
then.Nope it is just a field in , is that really the problem? 😄
What's the
dd($data)
?!So yeah. It's missing your expected
domain_check_id
. Where is that $data
coming from? I don't know how that part works.yeah i see now 😅
i am using this package
https://filamentphp.com/plugins/ralphjsmit-notifications-pro#native-filament-notifications-integration
Filament
Notifications Pro by Ralph J. Smit - Filament
Seamlessly integrate Laravel database notifications with Filament.
How do you mean where the $data come's from that just a array ? Maybe i don't understand you correctly for that matter 🙂
Yes, but what is included into
$data
? Where does that content come from. I just see that array. I don't know the plugin you are using.You mean like this plugin?
https://filamentphp.com/plugins/ralphjsmit-notifications-pro#native-filament-notifications-integration
Filament
Notifications Pro by Ralph J. Smit - Filament
Seamlessly integrate Laravel database notifications with Filament.
or in the class self? like the FilamentNotification.php
I mean
->constructUsing(function (array $data) {
. It doesn't include your expected data. But I don't even know where this data is coming from. How do you know what content it has?You mean this part of that class right/
Well, that's the method you are overwriting. Still doesn't show the data that is injected via
$data
Solution
i fixed it 😄 it was a stupid fault of me . I forgot to delete some old records i thought i did . Now it does the job just needed to edit the code for the id , It look like this now 😄