<?php

if (!function_exists('isActive')) {
    function isActive($routes, $activeClass = 'menu-active', $defaultClass = '')
    {
        $routes = is_array($routes) ? $routes : explode('|', $routes);

        foreach ($routes as $route) {
            if (request()->routeIs($route)) {
                return $activeClass;
            }
        }
        return $defaultClass;
    }
}
