crayon/nova-treeview
Composer 安装命令:
composer require crayon/nova-treeview
包简介
A Laravel Nova tool.
README 文档
README
Display a model in a Tree View with drag and drop functionality. Useful for category structure.
Setup
Make sure your model you wish to use in the tree structure has the following columns:
parent_id
is_active
order
Add the tool to NovaServiceProvider.php
Category Model Example:
Schema::create('categories', function (Blueprint $table) {
$table->unsignedInteger('id')->autoIncrement();
$table->string('title');
$table->string('slug');
$table->unsignedInteger('parent_id')->nullable();
$table->boolean('is_active')->default(true);
$table->tinyInteger('order')->default(0);
});
Usage
/app/Providers/NovaServiceProvider.php
...
use Day4\TreeView\TreeView;
...
public function tools()
{
return [
...
new TreeView([
// ['NAME_IN_SIDEBAR', 'TABLE_NAME']
['Categories', 'categories']
])
];
}
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-30