<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;

class APITokenVerificatorMiddlewere
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse)  $next
     * @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
     */
    public function handle(Request $request, Closure $next)
    {
          /*if($request->hasHeader('ahorrala-api-key')){
               if($request->header('ahorrala-api-key','')=='ahorrala2025'){
                     return $next($request);
                }else{
                    return response()->json(['status'=>'401','msg' => 'Sin Autorizacion para la API de Ahorrala.com'], 401);

                }
          }else{
                return response()->json(['status'=>'401','msg' => 'Sin Autorizacion para usar la API de Ahorrala.com'], 401);
          }*/
           return $next($request);
    
    }
}
