我有以下查询返回一组 user_ids,每个用户都会收到通知。
$pstusrmembs = DB::table('postusrs')
->where('post_id', $post_id)
->where('accepted', 1)
->pluck('user_id');
我需要将每个 user_id 放在下面“插入”代码的不同行中:
$notifs = new Notif();
$notifs->rec_uid = $pstusrmembs;
$notifs->title = $post_title;
$notifs->save();
我$notifs->rec_uid = $pstusrmembs;该如何改变才能做到这一点?
holdtom
神不在的星期二