Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages

Installation Instructions

composer require day4/tree-view

Readme

‼️ This repository is no longer maintained by the original author. PRs are still welcome, but active support is limited

Nova Tree View

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']
            ])
        ];
    }

Screenshots

Reviews

By dbateson on August 3, 2021

Doesn't work. Shame because this would be useful

By Milkhan on August 8, 2020

Thank you fro this nice package! If you cant see the page, run npm install & npm run production on the vendor directory of the package(\vendor\day4\tree-view).

By Arthur Minasyan on July 26, 2020

That's a good package. Thank you so much. My problem is that the categories page has nothing. I have copied migration and using a package in NovaServiceProvider. But when I go to categories page there is nothing without any error or something. So I hope that you can help me. Thanks.

By ssanchezromero on March 26, 2020

Thanks for the job but some functions are not working yet!

By alexandru-porcescu on March 14, 2020

Came really in handy, for our use case. Highly recommended!

Back to Top
Added 5 years ago
Last updated 5 Years Ago
Version 0.5.1
Composer
day4/tree-view
GitHub stars 9
Packagist downloads 91,563

Favorites

12 users favorited

Rating

4.10
(out of 5)
★★★★★
★★★★
★★★
★★
9 ratings

Contributors

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas