定制 infinety-es/nova-menu-builder 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

infinety-es/nova-menu-builder

最新稳定版本:v2.0.1

Composer 安装命令:

composer require infinety-es/nova-menu-builder

包简介

Menu Builder Tool for Laravel Nova.

README 文档

README

This tool allows you to create menus in Laravel Nova

menu builder Home

Menu Builder Items

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require infinety-es/nova-menu-builder

Then you should publish the database table file and migrate it:

php artisan vendor:publish --tag=menu-builder-migration
php artisan migrate

Usage

Next up, you must register the tool with Nova. This is typically done in the tools method of the NovaServiceProvider.

// in app/Providers/NovaServiceProvider.php

// ...

public function tools()
{
    return [
        // ...
        new \Infinety\MenuBuilder\MenuBuilder(),
    ];
}

Helpers

There are three helpers built in for your blades

  • menu_builder('slug').

    	Creates an html menu for given slug. Extra options are not required. By default tags are `ul` and `li`, and without html classes.
    
{!! menu_builder('main') !!}

//or

{!! menu_builder('main', 'parent-class', 'child-class', 'dl', 'dd') !!}
  • menu_name('slug').

    	Returns the name of the menu for a given slug.
    
{{ menu_name('main') }}
  • menu_json('slug').

    	Returns a json with all items for given slug.
    
{!! menu_json('main') !!}

Example using blade.

@foreach (getMenuBySlug('header')->parentItems as $menuItem)
    @include('menu-builder::menu-item', [
      'menu' => $menuItem,
      'active_top_class' => 'active',
      'active_child_class' => 'active',
    ])
@endforeach

Localization

Set your translations in the corresponding xx.json file located in /resources/lang/vendor/nova

"Menu Builder": "Menu Builder",
"Menu Items": "Menu Items",
"Add item": "Add item",
"Delete item": "Delete item",
"Are you sure to delete this menu item?": "Are you sure to delete this menu item?",
"Take care. All children items will be deleted cause you're deleting the parent.": "Take care. All children items will be deleted cause you're deleting the parent.",
"Cancel": "Cancel",
"Yes, remove!": "Yes, remove!",
"Add Menu item": "Add Menu item",
"Name": "Name",
"Slug": "Slug",
"Menu Helper": "Menu Helper",
"Link type": "Link type",
"Choose an option": "Choose an option",
"Static Url": "Static Url",
"Dynamic Route": "Dynamic Route",
"URL": "URL",
"Route": "Route",
"Parameters": "Parameters",
"Open in": "Open in",
"Same window": "Same window",
"New window": "New window",
"Classes": "Classes",
"Create menu item": "Create menu item",
"Update menu item": "Update menu item",
"Item removed successfully!": "Item removed successfully!",
"Item created!": "Item created!",
"Item updated!": "Item updated!",
"Menu reordered!": "Menu reordered!",
"Error on server!": "Error on server!",
"Enabled": "Enabled",
"Disabled": "Disabled"

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email apps@infinety.es instead of using the issue tracker.

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Infinety - Calle Comedias, 8 Floor 3, Suite 5 46003 Valencia (Spain).

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 14.74k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 65
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 65
  • Watchers: 3
  • Forks: 25
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-07