In default the ordering of left menu items is in alphabetical order.
我的客户想手动订购这些菜单.你知道怎么做吗?
Go to answer
In default the ordering of left menu items is in alphabetical order.
我的客户想手动订购这些菜单.你知道怎么做吗?
Go to answer
There are two ways to achieve this:
1. Priority Method个
public static $priority = 2;
public function boot()
{
Nova::sortResourcesBy(function ($resource) {
return $resource::$priority ?? 9999;
});
}
2. Ordering Resource models in NovaServiceProvider个
在NovaServiceProvider中,订购如下资源模型:
protected function resources()
{
Nova::resources([
User::class,
Post::class,
]);
}