Kernel.php 2.77 KB
Newer Older
1
2
3
4
<?php

namespace App\Http;

Jacob Priddy's avatar
Jacob Priddy committed
5
use Fruitcake\Cors\HandleCors;
Jacob Priddy's avatar
Jacob Priddy committed
6
7
8
9
10
11
12
use App\Http\Middleware\TrimStrings;
use App\Http\Middleware\Authenticate;
use App\Http\Middleware\TrustProxies;
use App\Http\Middleware\EncryptCookies;
use App\Http\Middleware\VerifyCsrfToken;
use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Auth\Middleware\RequirePassword;
Jacob Priddy's avatar
Jacob Priddy committed
13
use Illuminate\Http\Middleware\SetCacheHeaders;
Jacob Priddy's avatar
Jacob Priddy committed
14
15
16
use Illuminate\Session\Middleware\StartSession;
use App\Http\Middleware\CheckForMaintenanceMode;
use Illuminate\Routing\Middleware\ThrottleRequests;
Jacob Priddy's avatar
Jacob Priddy committed
17
use Illuminate\Foundation\Http\Kernel as HttpKernel;
Jacob Priddy's avatar
Jacob Priddy committed
18
19
use Illuminate\Routing\Middleware\ValidateSignature;
use Illuminate\Auth\Middleware\EnsureEmailIsVerified;
Jacob Priddy's avatar
Jacob Priddy committed
20
21
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\View\Middleware\ShareErrorsFromSession;
Jacob Priddy's avatar
Jacob Priddy committed
22
23
24
25
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
26
27
28
29
30
31
32
33
34
35
36

class Kernel extends HttpKernel
{
    /**
     * The application's global HTTP middleware stack.
     *
     * These middleware are run during every request to your application.
     *
     * @var array
     */
    protected $middleware = [
Jacob Priddy's avatar
Jacob Priddy committed
37
        TrustProxies::class,
Jacob Priddy's avatar
Jacob Priddy committed
38
        HandleCors::class,
Jacob Priddy's avatar
Jacob Priddy committed
39
40
41
42
        CheckForMaintenanceMode::class,
        ValidatePostSize::class,
        TrimStrings::class,
        ConvertEmptyStringsToNull::class,
Jacob Priddy's avatar
Jacob Priddy committed
43
        EncryptCookies::class,
44
45
46
47
48
49
50
51
52
    ];

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'web' => [
Jacob Priddy's avatar
Jacob Priddy committed
53
54
            AddQueuedCookiesToResponse::class,
            StartSession::class,
55
            // \Illuminate\Session\Middleware\AuthenticateSession::class,
Jacob Priddy's avatar
Jacob Priddy committed
56
57
58
            ShareErrorsFromSession::class,
            VerifyCsrfToken::class,
            SubstituteBindings::class,
59
60
61
        ],

        'api' => [
Jacob Priddy's avatar
Jacob Priddy committed
62
63
            // Throttle after 100 requests within 2 minutes
            'throttle:100,2',
64
65
            'bindings',
        ],
Jacob Priddy's avatar
Jacob Priddy committed
66
67

        'door' => [
68
            'auth:door',
Jacob Priddy's avatar
Jacob Priddy committed
69
70
            'bindings',
        ],
71
72
73
74
75
76
77
78
79
80
    ];

    /**
     * The application's route middleware.
     *
     * These middleware may be assigned to groups or used individually.
     *
     * @var array
     */
    protected $routeMiddleware = [
Jacob Priddy's avatar
Jacob Priddy committed
81
82
83
84
85
86
87
88
89
        'auth' => Authenticate::class,
        'auth.basic' => AuthenticateWithBasicAuth::class,
        'bindings' => SubstituteBindings::class,
        'cache.headers' => SetCacheHeaders::class,
        'can' => Authorize::class,
        'password.confirm' => RequirePassword::class,
        'signed' => ValidateSignature::class,
        'throttle' => ThrottleRequests::class,
        'verified' => EnsureEmailIsVerified::class,
90
91
    ];
}