I was able to create a Notification
table using migration. Also I can save notification if a user(X) replies to the post of user(Y). Now, the problem is, I want to send the notification to user(Y), but then, the notifiable_id
saves the id of user(X). How can user(Y) receive the notification then?
Auth::user()->notify(new PostNotif());
Example:
user(X) ID is : 12 and,
user(Y) ID is : 24
The notifications table looks like this:
type notifiable_id notifiable_type
App\Notifications\PostNotif 12 App\User
I expected that the notifiable_id should be the ID of user(Y) which is 24 and not 12.
Since, the user(Y) submitted a post and user(X) responded to that post, how can user(Y) be notified in this case?
EDIT
Also, I expect two IDs to be inserted into the database notification. One for the user who created the post and the other for the one who responded to the post.
Does anybody know about this?