<?php

namespace App\Http\Middleware;

use App\Services\Auth\User\AccountService;
use Closure;

class ServiceValid
{
    /**
     * Handle an incoming request.
     * Redirect user to admin login page if he has not the previliage to access the admin panel
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        (new AccountService())->setAccount();

        return $next($request);
    }
}
