2017-06-09 02:28:26 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http;
|
|
|
|
|
2019-07-18 22:51:05 +08:00
|
|
|
use App\Http\Middleware\ApiAuth;
|
|
|
|
use App\Http\Middleware\EncryptCookies;
|
|
|
|
use App\Http\Middleware\InstalledCheck;
|
|
|
|
use App\Http\Middleware\JsonResponse;
|
|
|
|
use App\Http\Middleware\RedirectIfAuthenticated;
|
|
|
|
use App\Http\Middleware\UpdatePending;
|
|
|
|
use App\Http\Middleware\VerifyCsrfToken;
|
|
|
|
use Illuminate\Auth\Middleware\Authenticate;
|
|
|
|
use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth;
|
|
|
|
use Illuminate\Auth\Middleware\Authorize;
|
|
|
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
2017-06-09 02:28:26 +08:00
|
|
|
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
2019-07-18 22:51:05 +08:00
|
|
|
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode;
|
|
|
|
use Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull;
|
|
|
|
use Illuminate\Foundation\Http\Middleware\TrimStrings;
|
|
|
|
use Illuminate\Routing\Middleware\SubstituteBindings;
|
|
|
|
use Illuminate\Routing\Middleware\ThrottleRequests;
|
|
|
|
use Illuminate\Session\Middleware\StartSession;
|
|
|
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
2017-06-09 02:28:26 +08:00
|
|
|
|
|
|
|
class Kernel extends HttpKernel
|
|
|
|
{
|
|
|
|
protected $middleware = [
|
2019-07-18 22:51:05 +08:00
|
|
|
CheckForMaintenanceMode::class,
|
|
|
|
TrimStrings::class,
|
|
|
|
ConvertEmptyStringsToNull::class,
|
2017-06-09 02:28:26 +08:00
|
|
|
];
|
|
|
|
|
2019-07-18 22:51:05 +08:00
|
|
|
protected $middlewareGroups = [
|
2017-06-09 02:28:26 +08:00
|
|
|
'api' => [
|
2019-08-23 00:45:15 +08:00
|
|
|
// 'throttle:60,1',
|
2017-06-09 02:28:26 +08:00
|
|
|
'bindings',
|
2017-12-29 12:50:07 +08:00
|
|
|
'json',
|
2017-06-09 02:28:26 +08:00
|
|
|
],
|
2019-07-18 22:51:05 +08:00
|
|
|
'web' => [
|
|
|
|
InstalledCheck::class,
|
|
|
|
EncryptCookies::class,
|
|
|
|
AddQueuedCookiesToResponse::class,
|
|
|
|
StartSession::class,
|
|
|
|
ShareErrorsFromSession::class,
|
|
|
|
VerifyCsrfToken::class,
|
|
|
|
SubstituteBindings::class,
|
|
|
|
//\Spatie\Pjax\Middleware\FilterIfPjax::class,
|
|
|
|
],
|
2017-06-09 02:28:26 +08:00
|
|
|
];
|
2019-08-27 00:32:46 +08:00
|
|
|
|
2017-06-09 02:28:26 +08:00
|
|
|
protected $routeMiddleware = [
|
2019-07-18 22:51:05 +08:00
|
|
|
'api.auth' => ApiAuth::class,
|
|
|
|
'auth' => Authenticate::class,
|
|
|
|
'auth.basic' => AuthenticateWithBasicAuth::class,
|
|
|
|
'bindings' => SubstituteBindings::class,
|
|
|
|
'can' => Authorize::class,
|
|
|
|
'guest' => RedirectIfAuthenticated::class,
|
|
|
|
'json' => JsonResponse::class,
|
|
|
|
'throttle' => ThrottleRequests::class,
|
|
|
|
'update_pending' => UpdatePending::class,
|
2017-06-09 02:28:26 +08:00
|
|
|
];
|
|
|
|
}
|