<?php

namespace App\Http\Middleware;

use Closure;

class HTTPRedirect
{

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @param  string|null  $guard
     * @return mixed
     */
    public function handle($request, Closure $next, $guard = null)
    {
        /*if(!$request->secure()){
            //dd($request);
            return redirect()->to(env('APP_URL').($request->getRequestUri()));
        }
        $url=url()->full();
        $url=explode("https://www",$url);
        if(count($url)>1){
            return redirect()->to(env('APP_URL').($request->getRequestUri()));
        }else{
            
        }*/
        //dd($request->secure());
        return $next($request);
      //return $next($request);
    }
}
