<?php

namespace App\Http;

use App\Game\Services\CheckGameLogin;
use App\Game\Services\GameEncrypt;
use App\Game\Services\MustGameLogin;
use App\Http\Middleware\AdminLog;
use App\Http\Middleware\ApiSign;
use App\Http\Middleware\CheckRole;
use App\Http\Middleware\EnableCrossRequestMiddleware;
use App\Http\Middleware\EncryptInOut;
use App\Http\Middleware\Filter26;
use App\Http\Middleware\NewApiSign;
use App\Http\Middleware\RedApiSign;
use App\Http\Middleware\ThrottleRequests;
use Illuminate\Foundation\Http\Kernel as HttpKernel;

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 = [
        \App\Http\Middleware\CheckForMaintenanceMode::class,
        \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
        \App\Http\Middleware\TrimStrings::class,
        \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
        \App\Http\Middleware\TrustProxies::class,
    ];

    /**
     * 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\Session\Middleware\AuthenticateSession::class,
            \Illuminate\View\Middleware\ShareErrorsFromSession::class,
            \App\Http\Middleware\VerifyCsrfToken::class,
            \Illuminate\Routing\Middleware\SubstituteBindings::class,
        ],

        'api' => [
            'throttle:60,1',
            'bindings',
            'filter26',
        ],
    ];

    /**
     * The application's route middleware.
     *
     * These middleware may be assigned to groups or used individually.
     *
     * @var array
     */
    protected $routeMiddleware = [
        'verified'      => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
        'rbac'          => \App\Http\Middleware\Rbac::class,
        'session.check' => \App\Http\Middleware\CheckSession::class,
        'install.check' => \App\Http\Middleware\CheckInstall::class,
        'test' => AdminLog::class,
        'check.role' => CheckRole::class,
        'apiSign' => ApiSign::class,
        'RedApiSign' => RedApiSign::class,
        'EncryptInOut' => EncryptInOut::class,
        'GameEncrypt' => GameEncrypt::class,
        'newApiSign' => NewApiSign::class,
        'checkGameLogin' => CheckGameLogin::class,
        'mustGameLogin' => MustGameLogin::class,
        'filter26' => Filter26::class,
        'cors' => EnableCrossRequestMiddleware::class,
        'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
        'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
    ];
}
