<?php

namespace Sartoric\ModularCms\Middleware;

use Closure;

//use Illuminate\Support\Facades\Auth;

class LockAccount
{

    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */

    public function handle($request, Closure $next)
    {
        if ($request->session()->has('locked')) {
            return redirect('/lock');
        }
        return $next($request);
    }
}
