<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;
use Mcamara\LaravelLocalization\Facades\LaravelLocalization;

class CheckCode
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $secret = 'mV01L7DcbbG7Vf44R+7+CnyCKtt/pkN37p78+lFfROU1x3V8HltpFsy2WlsMicrmZSdVCNlgstnY6a//b487sA==';
        $header_secret = $request->header('MyFatoorah-Signature');

        // if($header_secret != $secret)
        // {
        //     return response()->json([
        //         'data'=>'UnAuthorized'
        //     ],  401);
        // }
        return $next($request);
    }
}
