As Laravel shipped with a default notification module. It provides us following notifications_table.

id type notifiable_type notifiable_id data read_at created_at updated_at
fd71b94e-a0fc-42d5-9cfc-d0019cd83468 Notifications\PushNotification User 23 {"user_name":"Bak thonas","texts":"testing"} null 2023-01-09 12:43:02 2023-01-09 12:43:02

I added some custom columns by overriding the notification-table migration according to my requirement. After adding these columns notifications_table looks something like that,

id type notifiable_type notifiable_id relation_type relation_id subject_en subject_ar message_en message_ar data read_at created_at updated_at
fd71b94e-a0fc-42d5-9cfc-d0019cd83468 Notifications\PushNotification User 23 B 22 Welcome مرحبا Welcome to platform! مرحبا بكم في Platform! {"user_name":"Bak thonas","texts":"testing"} null 2023-01-09 12:43:02 2023-01-09 12:43:02

Note: I want to customize the default database channel shipped with Laravel. so this way I would just need to customize that data-building structure before storing it in a database instead repeating everything that is already provided in Laravel by default

0

There are 0 best solutions below