angularjs file
$http({
method: 'POST',
url: API_URL + "produto/update" + "/" + produtoSelecionado,
data: $.param(obj),
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
}).success(function (response) {
console.log(response);
alert(response);
location.reload();
}).error(function (response) {
console.log(response);
alert('An error has occured. Please check the log for details.');
});
location.reload();
php controller:
public function decreaseQuantity(Request $request, $id)
{
DB::table('product') ->where('id', $id) -> decrement('quantity',$request->input('quantity'));
}
Это выдает мне эту ошибку все время, даже если я передаю определенное значение количества.

Я проверяю переменную obj
, чтобы узнать, не было ли с ней проблемы, но в порядке, значение там.Странно то, что у меня есть совершенно другая функция, которая делает то же самое, но вместо декремента, инкремента и она работает нормально, только эта делает, и я не знаю, почему