PHP code example of soeurngsar / menubuilder

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

    

soeurngsar / menubuilder example snippets


composer 

php artisan vendor:publish --provider="SoeurngSar\MenuBuilder\MenuServiceProvider"

 php artisan migrate
 


@section('contents')
    {!! Menu::render() !!}
@endsection



@section('contents')
    {!! Menu::renderBootstrapNav('Brand Text','menu name','navbar-default') !!}
@endsection


use SoeurngSar\MenuBuilder\app\Facades\Menu;
...
/*
Parameter: Menu ID
Return: Array
*/
$menuList = Menu::get(1);

use SoeurngSar\MenuBuilder\app\Facades\Menu;
...
/*
Parameter: Menu ID
Return: Array
*/
$menuList = Menu::getByName('Primary');

use SoeurngSar\MenuBuilder\app\Models\Menus;
use SoeurngSar\MenuBuilder\app\Models\MenuItems;