PHP code example of yard / brave-components
1. Go to this page and download the library: Download yard/brave-components 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/ */
yard / brave-components example snippets
blade
@php($menu = \Log1x\Navi\Navi::make()->build('primary_navigation'))
@if ($menu->isNotEmpty())
<x-brave::nav aria-label="{{ __('Primaire navigatie', 'sage') }}">
<x-brave::nav.list>
@foreach ($menu->all() as $item)
<x-brave::nav.item class="group">
<x-brave::nav.link :item="$item" class="text-blue-500" activeClass="text-red-500">
{!! $item->label !!}
@if ($item->children)
<i class="fa-light fa-chevron-down"></i>
@endif
</x-brave::nav.link>
@if ($item->children)
<x-brave::nav.dropdown mode="hover" @class([
'invisible absolute bg-white',
'group-has-aria-expanded:visible',
])>
@foreach ($item->children as $child)
<x-brave::nav.item>
<x-brave::nav.link :item="$child" class="text-blue-500" activeClass="text-red-500">
{!! $child->label !!}
</x-brave::nav.link>
</x-brave::nav.item>
@endforeach
</x-brave::nav.dropdown>
@endif
</x-brave::nav.item>
@endforeach
</x-brave::nav.list>
</x-brave::nav>
@endif