PHP code example of osaris-uk / navigation

1. Go to this page and download the library: Download osaris-uk/navigation 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/ */

    

osaris-uk / navigation example snippets


    'navigations' => [
        '_layouts.partials.navigation' => 'main',
        'admin._layouts.partials.navigation' => [
            'admin',
            'admin_shortcuts'
        ],
    ],
bash
php artisan vendor:publish --provider="OsarisUk\Navigation\NavigationServiceProvider" --tag="config"
html
    @foreach($navItems as $navItem)
    	@continue($navItem->realm !== 'admin') <!-- Select only 'admin' nav items where more than one group passed to the view. -->
    	
        @if (count($navItem['children']))
            <li class="has-child">
                <a href="{{ $navItem->route ? route($navItem->route) : '' }}{{ $navItem->target }}">{{ $navItem->title }}</a>
                <div class="dropdown left-indent">
                    <ul class="dropdown-items">
                        @foreach($navItem['children'] as $child)
                            <li>
                                <a href="{{ $child->route ? route($child->route) : '' }}{{ $child->target }}">{{ $child->title }}</a>
                            </li>
                        @endforeach
                    </ul>
                </div>
            </li>
        @else
            <li>
                <a href="{{ $navItem->route ? route($navItem->route) : '' }}{{ $navItem->target }}">{{ $navItem->title }}</a>
            </li>
        @endif
    @endforeach