Skip to content

Commit 17473fe

Browse files
Merge pull request dingo#1698 from specialtactics/bugfix/prepare-validation-called-twice
Fix a bug introduced in earlier version which caused prepareForValidation() to be called twice
2 parents f0a32f1 + d4a2112 commit 17473fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Provider/LaravelServiceProvider.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ public function boot()
4444
$this->updateRouterBindings();
4545
});
4646

47-
// Validate FormRequest after resolving
47+
// Originally Validate FormRequest after resolving
48+
/* This casues the prepareForValidation() function to be called twice, and seemingly has no other benefit, see discussion at
49+
https://github.com/dingo/api/issues/1668
50+
This is already done by laravel service provider, and works with Dingo router
4851
$this->app->afterResolving(ValidatesWhenResolved::class, function ($resolved) {
4952
$resolved->validateResolved();
5053
});
54+
*/
5155

5256
$this->app->resolving(FormRequest::class, function (FormRequest $request, Application $app) {
5357
$this->initializeRequest($request, $app['request']);

0 commit comments

Comments
 (0)