Update shopping cart - cakephp 3.8

The URL is correct. I can display /pedidos/update/1, for example.
And the controller name is capitalized now. Thanks for clarifying this!

I also tried:
.
.
if ($quantidade > 0) {
$carrinho->write(“carrinho.$index”, $quantidade);
return $this->redirect([‘action’ => ‘index’]);
}
.
.
Error: Call to a member function write() on array

Two products with quantity ($quantidade) equal to 1 in the cart.
screen 01