Service/ApiHelper.php
public function handleForm(Request $request,Form $form){
        // The JSON PUT data will include all attributes in the entity, even
        // those that are not updateable by the user and are not in the form.
        // We need to remove these extra fields or we will get a
        // "This form should not contain extra fields" Form Error
        $data = $request->request->all();
        $children = $form->all();
        //Eliminamos los datos del request que no pertenecen al formulario
        $data = array_intersect_key($data, $children);
        $form->submit($data);
        return $form;
    }
public function handleForm(Request $request,Form $form){
        // The JSON PUT data will include all attributes in the entity, even
        // those that are not updateable by the user and are not in the form.
        // We need to remove these extra fields or we will get a
        // "This form should not contain extra fields" Form Error
        $data = $request->request->all();
        $children = $form->all();
        //Eliminamos los datos del request que no pertenecen al formulario
        $data = array_intersect_key($data, $children);
        $form->submit($data);
        return $form;
    }
public function handleForm ( Request $ request , Form $ form ) { // The JSON PUT data will include all attributes in the entity, even // those that are not updateable by the user and are not in the form. // We need to remove these extra fields or we will get a // "This form should not contain extra fields" Form Error $ data = $ request -> request -> all ( ) ; $ children = $ form -> all ( ) ; //Eliminamos los datos del request que no pertenecen al formulario $ data = array_intersect_key ( $ data , $ children ) ; $ form -> submit ( $ data ) ; return $ form ; }
Se hace un submit de los campos de un request que esten definidos en un formulario
@param Request $request
@param Form $form
@return Form
Se hace un submit de los campos de un request que esten definidos en un formulario