<?php

namespace App\Http\Middleware;

use Closure;

class CheckStatus
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if ($_SERVER['HTTP_MID_CLIENT_KEY'] == 'c3KXBBZu8ben1GXE0Cr3') {
            return $next($request);
        }
        return response()->json('Your tokes is invalid');
    }
}
