Closed MovingGifts closed 7 years ago
Please open an issues for the internals repo if you have a RFC, or ask on the forums if you'd just like to talk about implementations with people please. :)
I asked here on the forums for others.
Please open an issues for the internals repo if you have a RFC
@GrahamCampbell Can you point me to a url please so I can check it out?
Hello!
So for a single
notifiable
user, a single entry in thenotifications
table, along with amail
/sms
sent is perfectly working.An important issue I'm facing with this however, is when I have a user collection, a list of 1k users following me, and I post an update. Here is what happens when using the
Notifiable
trait as suggested for multi user case:mails
/sms
sent (issue not here)notifications
tableIt seems that adding 1k notifications to the db
notifications
table is not an optimal solution. Since thetoArray
data is the same, and everything else in the dbnotifications
table is the same for 1k rows, with the only difference being thenotifiable_id
of theuser
notifiable_type
.An optimal solution out of the box would be:
array
notifiable_type
notifiable_type
user_array
oruser
withnotifiable_id
0 (zero would only be used to signify it's a multi notifiable user)notifications_read
using thenotification_id
it just created as theforeign_key
and insert 1k rows, of just these fields:notification_id
notifiable_id
notifiable_type
read_at
I am hoping there is already a way to do this as I am at this point in my application and would love to use the built in Notifications for this situation, as I am firing off emails/sms notifications, which is fine to repeat 1k times I think, but it's the entry of the same data into the db that is the problem that needs to be optimized.
Any thoughts/ideas how to proceed in this situation?