Laravel - Notifications - Todatabase Vs Toarray
The toArray
method is also used by the broadcast
channel to determine which data to broadcast to your JavaScript powered frontend. If you would like to have two different array representations for the database
and broadcast
channels, you should define a toDatabase
method instead of a toArray
method.