Skip to content

Commit

Permalink
[feature/validation-wrapping] Add note about the onFail return behavior
Browse files Browse the repository at this point in the history
Clarified that the onFail callback will not trigger ValidationException if it returns false. This ensures better understanding for customizing validation failure handling and avoids potential issues in form submission.
  • Loading branch information
midnite81 committed Sep 4, 2024
1 parent e16c711 commit d0cc63c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/Handlers/ValidationHandler.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class YourController extends Controller
->onFail(function ($request, $errors) {
// Optional: Custom failure handling
// This will be called before the ValidationException is thrown
// Unless you return false
Log::warning('Form submission failed', ['errors' => $errors->toArray()]);
})
->finally(function ($request, $passed) {
Expand Down

0 comments on commit d0cc63c

Please sign in to comment.