Skip to content

Commit

Permalink
Merge pull request #147 from inertiajs/register-middleware-in-group
Browse files Browse the repository at this point in the history
Automatically register middleware in "web" group
  • Loading branch information
reinink authored Sep 17, 2020
2 parents 0a9af99 + 9a9fd4d commit 4f0e1ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Collection;
use Illuminate\Contracts\Http\Kernel;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;

Expand Down Expand Up @@ -51,7 +52,10 @@ protected function registerRouterMacro()

protected function registerMiddleware()
{
$this->app[Kernel::class]->pushMiddleware(Middleware::class);
$this->app[Kernel::class]->appendMiddlewareToGroup(

This comment has been minimized.

Copy link
@obaid

obaid Sep 30, 2020

@reinink this is breaking support for Laravel 5.x. Can you elaborate on why is this needed?

This comment has been minimized.

Copy link
@reinink

reinink Sep 30, 2020

Author Member

See #147 and #152.

Config::get('inertia.middleware_group', 'web'),
Middleware::class
);
}

protected function shareValidationErrors()
Expand Down

0 comments on commit 4f0e1ef

Please sign in to comment.