@@ -17,7 +17,7 @@ control over when exactly your form is submitted and what data is passed to it::
1717 $form = $this->createForm(TaskType::class, $task);
1818
1919 if ($request->isMethod('POST')) {
20- $form->submit($request->request->all ($form->getName()));
20+ $form->submit($request->getPayload()->get ($form->getName()));
2121
2222 if ($form->isSubmitted() && $form->isValid()) {
2323 // perform some action...
@@ -41,7 +41,7 @@ the fields defined by the form class. Otherwise, you'll see a form validation er
4141 if ($request->isMethod('POST')) {
4242 // '$json' represents payload data sent by React/Angular/Vue
4343 // the merge of parameters is needed to submit all form fields
44- $form->submit(array_merge($json, $request->request ->all()));
44+ $form->submit(array_merge($json, $request->getPayload() ->all()));
4545
4646 // ...
4747 }
@@ -73,4 +73,4 @@ the fields defined by the form class. Otherwise, you'll see a form validation er
7373 manually so that they are validated::
7474
7575 // 'email' and 'username' are added manually to force their validation
76- $form->submit(array_merge(['email' => null, 'username' => null], $request->request ->all()), false);
76+ $form->submit(array_merge(['email' => null, 'username' => null], $request->getPayload() ->all()), false);
0 commit comments