Skip to content

Instantly share code, notes, and snippets.

@nicolaskempf57
Created May 8, 2020 13:24
Show Gist options
  • Save nicolaskempf57/ebc356b6da2600fd0f42babfa4f9a509 to your computer and use it in GitHub Desktop.
Save nicolaskempf57/ebc356b6da2600fd0f42babfa4f9a509 to your computer and use it in GitHub Desktop.
Extract from Laravel App\Http\Kernel for my blog post on Laravel Middleware https://medium.com/blog-justenico/laravel-les-middlewares-59b651d80b10
<?php
/**
 * The application's route middleware groups.
 *
 * @var array
 */
protected $middlewareGroups = [
'web' => [
  \App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
  \Illuminate\Session\Middleware\StartSession::class,
  \Illuminate\View\Middleware\ShareErrorsFromSession::class,
  \App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
  ],
'api' => [
  'throttle:60,1',
  'auth:api',
  ],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment