-
-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Is your feature request related to a problem? Please describe.
I'd like to log all requests - successes or otherwise.
Describe the solution you'd like
I think the simplest, most expressive solution would be to manually set some public attribute doneClosure, which would be called from the $form->done() method.
$form = new Form();
$form->doneClosure = fn($form) => log($form);Describe alternatives you've considered
I considered passing the closure to the done method $form->done(fn($form) => log($form)) instead, but the form itself calls done() without any argument when failing, for instance, and I couldn't figure out better way to pass it around other than have it on the object and call it from done() if not null.
I currently extend the Form object - and the extension contains only the overloaded done() method and private doneClosure().
Additional context
I will PR this if accepted