Simple package for manage tree models (category, menu, catalog, etc.)
Support Nova 4
The model must have columns parent_id
and order
, both type int.
Start with installing the package
composer require krendil/model-tree
Then register the tool inside the NovaServiceProvider.php
public function tools()
{
return [new ModelTree];
}
Add to menu, in the resource()
method, insert your resource model
(new \Krendil\ModelTree\ModelTree)
->resource(Category::class)
->menu($request)