<?php

namespace App\Http\Middleware;

use Closure;

class CheckTimeMaintenance
{
    public function handle($request, Closure $next)
    {
        $time = date('H');
        
        if($time == 00 || $time == 02 || $time == 03 || $time == 04 || $time == 05 || $time == 06 || $time == 07 ){
        	abort(501);
        }
        
        // $time = date('H.15');
        
        // if($time == 00 || $time == 01 || $time == 02 || $time == 03 || $time == 04 || $time == 05  || $time == 17){
        // 	abort(501);
        // }
        
        // $x =1;
        
        // if($x == 1){
        //     abort(501);
        // }
        
      
        return $next($request);
    }
    
}