I tried to find the solution online, but most setups are basic.
Lets say you have a product in stock, and you want to make sure nobody buys the product if it isn't is stock.
Good, I will make a form request that checks the stock, then I will reduce the quantity in the controller.
But the problem is, with parallel requests, the product can reach negative value.
Now, most tutorials I saw online, will check the stock inside the controller, not inside the form request. But how to do it in my case? I wanna send the stock error back to the user. not throw an error. Do I have to duplicate my logic inside the controller as well?