Skip to content

Commit

Permalink
Fixes #13453 by firing the RouteMatched event to be able to deal with…
Browse files Browse the repository at this point in the history
… FormRequests (#13474)

initisalize FormRequest regardless of the RouteMatched event
  • Loading branch information
themsaid authored and taylorotwell committed May 18, 2016
1 parent 1a3aa9a commit b5ffdb1
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Routing\Redirector;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Routing\Events\RouteMatched;
use Symfony\Component\HttpFoundation\Request;
use Illuminate\Contracts\Validation\ValidatesWhenResolved;

Expand Down Expand Up @@ -42,12 +41,10 @@ protected function configureFormRequests()
$resolved->validate();
});

$this->app['events']->listen(RouteMatched::class, function () {
$this->app->resolving(function (FormRequest $request, $app) {
$this->initializeRequest($request, $app['request']);
$this->app->resolving(function (FormRequest $request, $app) {
$this->initializeRequest($request, $app['request']);

$request->setContainer($app)->setRedirector($app->make(Redirector::class));
});
$request->setContainer($app)->setRedirector($app->make(Redirector::class));
});
}

Expand Down

0 comments on commit b5ffdb1

Please sign in to comment.