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

namespace App\Http;

Jacob Priddy's avatar
Jacob Priddy committed
5
6
7
8
9
10
11
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
12
use Illuminate\Http\Middleware\SetCacheHeaders;
Jacob Priddy's avatar
Jacob Priddy committed
13
14
use Illuminate\Session\Middleware\StartSession;
use App\Http\Middleware\CheckForMaintenanceMode;
Jacob Priddy's avatar
Jacob Priddy committed
15
use App\Http\Middleware\RedirectIfAuthenticated;
Jacob Priddy's avatar
Jacob Priddy committed
16
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
use Illuminate\Routing\Middleware\SubstituteBindings;
Jacob Priddy's avatar
Jacob Priddy committed
21
use Illuminate\Session\Middleware\AuthenticateSession;
Jacob Priddy's avatar
Jacob Priddy committed
22
use Illuminate\View\Middleware\ShareErrorsFromSession;
Jacob Priddy's avatar
Jacob Priddy committed
23
24
25
26
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
use Illuminate\Foundation\Http\Middleware\ValidatePostSize;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
27
28
29
30
31
32
33
34
35
36
37

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
38
39
40
41
42
        TrustProxies::class,
        CheckForMaintenanceMode::class,
        ValidatePostSize::class,
        TrimStrings::class,
        ConvertEmptyStringsToNull::class,
43
44
45
46
47
48
49
50
51
    ];

    /**
     * The application's route middleware groups.
     *
     * @var array
     */
    protected $middlewareGroups = [
        'web' => [
Jacob Priddy's avatar
Jacob Priddy committed
52
53
54
            EncryptCookies::class,
            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' => [
62
            EncryptCookies::class,
63
64
65
            'throttle:60,1',
            '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
92
93
94
95
96
97
98
99
    ];

    /**
     * The priority-sorted list of middleware.
     *
     * This forces non-global middleware to always be in the given order.
     *
     * @var array
     */
    protected $middlewarePriority = [
Jacob Priddy's avatar
Jacob Priddy committed
100
101
102
103
104
105
106
        StartSession::class,
        ShareErrorsFromSession::class,
        Authenticate::class,
        ThrottleRequests::class,
        AuthenticateSession::class,
        SubstituteBindings::class,
        Authorize::class,
107
108
    ];
}