{{-- renderMenu.blade.php --}} {{-- Read JSON file --}} @php $menuData = file_get_contents('verticalMenu.json'); $menuArray = json_decode($menuData, true); @endphp {{-- Function to check if user has permission for a given slug --}} @php function hasPermission($slug) { // Implement your permission logic here // For example, check if the user has permission to access the given slug return true; // Return true or false based on permission } @endphp {{-- Render menu --}}