How to put begintransaction in the queue? Guys, welcome. Transaction Question: There is a script that changes the cell. But the fact is that if I, for example, make a simultaneous request from two devices, then one request (which is first) is executed, and the second is not. And it is necessary that both were executed, only in the order of the queue. How to implement like. I did not find information on this issue, but maybe I just didn’t correctly ask a question.
DB::beginTransaction(); $balanceNow = Users::find(Auth::id()); if ($balanceNow < $request->sum) { return Response::json([ "errors" => ["Ошибка"] ], 422); } $response = json_decode(Wallet::send($request->address, $request->sum)); //записи в базе if ($response->desc == 'OK') { DB::commit(); }else{ DB::rollBack(); } Thank you in advance for the tip in this question.