rapyd-laravel
rapyd-laravel copied to clipboard
Form passed problem
Hi I cant find info how to validate/upload all form fields created with \DataForm::create() Ex function attached to image is never called with passed function:
$form = \DataForm::create()
$form->add( $key, 'Image', 'image' )->moveDeferred('uploads/tmp/{{$id}}')->image( function ($image){
/* not called */
} );
$form->passed( function( $form ) use ($quiz){
/* what to call to handle input file and others*/
})
Also how to set value to image input so it can be deleted or changed ?
Answer for my first question: you can't use moveDeferred with \DataForm::create()
roger, for the second question the problem is here https://github.com/zofe/rapyd-laravel/blob/master/src/DataForm/DataForm.php#L497 I'll fix
For second question thing is tricky: You can't just use delete checbox like in edit form because it can't find image. It had to be done in $form->passed function by checking if hidden input was send with delete request. Hidden input must be added as form field with name/path of image.