$limit = 2000; for ($i = 0; $i < $countUsersForNotification; $i = $i+$limit) { $users = User::where('ostatok', '>=', 0) ->where('istatus', '=', '2') ->where('cstatus', '=', '2') ->where('deleted', '=', 0) ->where('tpid', '!=', 1) ->where('dateact', '>=', now()) ->offset($i) ->limit($limit) ->get(); Notification::send($users, new AbonentMessages($request->heading, $request->short, $request->alertBody)); dump('test'); }
Обсуждают сегодня