简体   繁体   English

使用 Voyager 为 Laravel 项目创建动态菜单

[英]Create dynamic menu for Laravel project using Voyager

I'm creating a new website with Laravel and use Voyager as admin panel for my website.我正在使用 Laravel 创建一个新网站,并使用 Voyager 作为我网站的管理面板。

The problem is let's assume that we want to create a menu with menu builder for all categories, so when we add or delete a category it will be also added/deleted from our menu and use it on my frontend.问题是假设我们想为所有类别创建一个带有菜单构建器的菜单,所以当我们添加或删除一个类别时,它也会从我们的菜单中添加/删除并在我的前端使用它。

Like as I saw with the menu builder we can just add a static item with it's route.就像我在菜单生成器中看到的那样,我们可以添加一个 static 项目及其路线。

Thanks谢谢

Currently the only way to programmatically manage menus with Voyager is to work directly with the menus and menu_items tables directly.目前,使用 Voyager 以编程方式管理菜单的唯一方法是直接使用menusmenu_items表。

In the Voyager admin panel, the menus are configured with BREAD .在 Voyager 管理面板中,菜单配置为BREAD There is an open Github issue to make BREAD available programmatically, which would then allow one to manage the menus programmatically, but it has not been developed yet.一个开放的 Github 问题以编程方式使 BREAD 可用,然后允许以编程方式管理菜单,但尚未开发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM