$ request-input always returns null

0

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')); 
            }

It always gives me error that the value is null as it is in the image

I have already checked the value of the variable obj and it has the value that I want but for some reason it does not pass to the controller. And even if I put a fixed value it also does not pass .. Any suggestions?

    
asked by anonymous 07.06.2018 / 18:57

0 answers