Notifications to database. #1525
Unanswered
joe-hagerty
asked this question in
Q&A
Replies: 1 comment
-
I have something that works, but I am not sure exactly why. It turns out that the morphMany was not expecting a user, but a class which tells it which table to put the notifications in. I had to add to my custom BackupHasFailedNotification.php file.
Then to my CustomNotifiable.php class, I had to add
and
This should probably be DatabaseNotification:class, but I am getting data into the database now. just for clarity my config/backup.php now contains:
Obviously I still need to build the other Notifications. Any other suggestions to help would be appreciated. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I log my notifications to a database, so I can then send a single notification digest at the end of the day.
Trying to configure database notifications I first tried just exchanging
mail
todatabase
in the config. But the default notifications do not have a toArray or toDatabase method, so I created my own notification, with a toArray function. Now I am recieving an error message:I believe this is because the database notification is expecting a user to be passed to it, and that I would need to further extend
Spatie\Backup\Notifications\Notifiable
but besides adding a morphMany() function, I am not sure what it is looking for.Does anyone have any pointers?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions