PHP code example of reedware / nova-treeview

1. Go to this page and download the library: Download reedware/nova-treeview 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/ */

    

reedware / nova-treeview example snippets


\Reedware\NovaTreeview\TreeviewServiceProvider::class
html
@if(count(Nova::availableResources(request())))
    <treeview tag="div" toggle-tag="h3" toggle-class="cursor-pointer flex items-center font-normal dim text-white mb-6 text-base no-underline">
        <template slot="label">
            <svg class="sidebar-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
                <!-- Resources Label -->
            </svg>
            <span class="sidebar-label flex-1">{{ __('Resources') }}</span>
        </template>

        <template slot="menu">
            @foreach($navigation as $group => $resources)
                @if(count($groups) > 1)
                    <h4 class="ml-8 mb-4 text-xs text-white-50% uppercase tracking-wide">{{ $group }}</h4>
                @endif

                <ul class="list-reset mb-8">
                    @foreach($resources as $resource)
                        <li class="leading-tight mb-4 ml-8 text-sm">
                            <!-- Link to each Resource -->
                        </li>
                    @endforeach
                </ul>
            @endforeach
        </template>
    </treeview>
@endif
html
@if(count(Nova::availableResources(request())))
    <treeview tag="div" toggle-tag="h3" toggle-class="cursor-pointer flex items-center font-normal dim text-white mb-6 text-base no-underline">
        <template slot="label">
            <svg class="sidebar-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
                <!-- Resources Label -->
            </svg>
            <span class="sidebar-label flex-1">{{ __('Resources') }}</span>
        </template>

        <template slot="menu">
            @foreach($navigation as $group => $resources)
                @if(count($groups) > 1)
                    <treeview tag="div" toggle-tag="h4" toggle-class="cursor-pointer flex items-center ml-8 mb-4 text-xs text-white-50% dim uppercase tracking-wide">
                        <template slot="label">
                            <span class="flex-1">{{ $group }}</span>
                        </template>

                        <template slot="menu">
                @endif

                <ul class="list-reset mb-8">
                    @foreach($resources as $resource)
                        <li class="leading-tight mb-4 ml-8 text-sm">
                            <!-- Link to each Resource -->
                        </li>
                    @endforeach
                </ul>

                @if(count($groups) > 1)
                        </template>
                    </treeview>
                @endif

            @endforeach
        </template>
    </treeview>
@endif