Menus

Menus

Menus Items Management.

Moamen Eltouny (Raggi)
PHP Version : >= 7.2 Laravel Version : >= 6.0 License Support
Source Packagist Version Packagist Downloads

Install

Install the latest version using Composer

composer require pharaonic/laravel-menus
php artisan migrate

OptionalPublish the views & migrations.

php artisan vendor:publish --tag=laravel-menus
Creating

Depends on Translatable.

You can create your menu item or manipulate it.

use Pharaonic\Laravel\Menus\Models\Menu;

// 1. Section
// 2. Title
// 3. URL
// 4. Sort [integer] (Optional)
// 5. Visible [boolean] (Optional)
// 6. Locale [string] (Optional)
$item = Menu::create('header', 'RaggiTech', 'https://raggitech.com');
Scopes

section (string $section, string $locale = null)

You can get menu items of a specific section.

use Pharaonic\Laravel\Menus\Models\Menu;

// 1. Section
// 1. Locale [string] (Optional)
$items = Menu::section('header')->get();
Directives

menu (string $section)

Getting menu items of a specific section in Blade.

@menu('header')