<?php

namespace App\Http\Middleware;

use Auth;
use Closure;

class Offline {

    public function handle($request, Closure $next)
    {
        if(options('offline')) {
            if(!Auth::check() || !Auth::user()->isSuper()) abort(503);
        }

        return $next($request);
    }
}
?>
