<?php

namespace App\Http\Middleware;

use App\Services\CheckActiveMenuService;
use Closure;
use Illuminate\Http\Request;

class CheckActiveMenu
{
    /**
     * Handle an incoming request.
     *
     * @param Request $request
     * @param \Closure $next
     * @return mixed
     */
    public function handle(Request $request, Closure $next)
    {
        $response = $next($request);
        CheckActiveMenuService::set($request);
        return $response;
    }
}
