PHP code example of weprodev / laranav

1. Go to this page and download the library: Download weprodev/laranav library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

weprodev / laranav example snippets


php artisan vendor:publish --provider="WeProDev\LaraNav\Provider\LaraNavServiceProvider"

@can($item['permission'] ?? null)
    <li class="nav-item {{ $item['parent_attributes']['class'] ?? '' }}">
        <a class="nav-link {{ $item['attributes']['class'] ?? '' }}"
            @if (!empty($item['children'])) data-bs-toggle="collapse"
                data-toggle="collapse"
                aria-expanded="false"
                aria-controls="{{ $item['url'] }}"
                href="#{{ $item['url'] }}"
            @else
                href="@php match ($item['type']) {
                    'PATH' => url($item['url']),
                    'ROUTE' => route($item['url']),
                    default => $item['url']
                } @endphp"> @endif
            <span class="menu-title">{{ $item['title'] }}</span>

            @if (!empty($item['children']))
                <i class="menu-arrow"></i>
            @endif
            @isset($item['icon'])
                <i class="{{ $item['icon'] }}"></i>
            @endisset
        </a>
        @if (!empty($item['children']))
            <div class="collapse" id="{{ $item['url'] }}">
                <ul class="nav flex-column sub-menu">
                    @foreach ($item['children'] as $child)
                        @