<?php

if (!function_exists('isActive')) {
    function isActive($page)
    {
        $currentRoute = request()->route()->getName();
        
        if (str_contains($currentRoute, 'services')) {
            return $currentRoute == $page ? 'active' : '';
        } else {
            return $currentRoute == $page ? 'class="active"' : '';
        }
    }
}