php - How to notify the person based on his post in laravel -
i new laravel notifications please bare me.
i able create notification
table using migration. can save notification if user(x) replies post of user(y). now, problem is, want send notification user(y), then, notifiable_id
saves id of user(x). how can user(y) receive notification then?
auth::user()->notify(new postnotif());
example:
user(x) id : 12 and,
user(y) id : 24
the notifications table looks this:
type notifiable_id notifiable_type app\notifications\postnotif 12 app\user
i expected notifiable_id should id of user(y) 24 , not 12.
since, user(y) submitted post , user(x) responded post, how can user(y) notified in case?
edit
also, expect 2 ids inserted database notification. 1 user created post , other 1 responded post.
does know this? thanks
i using table structure send notification,
type
notification_id
sender_id
receiver_id
you can store userx
in sender_id , usery
in receiver_id, wise versa.
i hope works.
Comments
Post a Comment