In my meetings table, I store information about different meetings where two types of users can participate: visitor type user and host type user. There is a many-to-many relationship between users and meetings, so I have a pivot table called meeting_user. My goal is to send an email to all selected users for a specific meeting.
However, when trying to send emails, the meeting_id is being stored in the notifiable_id column of the database instead of the users_id. How can I ensure that the notifiable_id column stores the correct users_id?
$meetings->save();
$meetings->users()->attach($request->user_id);
$users = Meeting::with('users')->get();
\Mail::to($user->send(New NewMeeting($meetings('id')));