1. Go to this page and download the library: Download artisanweblab/nested-tree library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use ArtisanWebLab\NestedTree\Database\Traits\NestedTreeTrait;
class Category extends Model
{
use NestedTreeTrait;
// You can change the column names used by declaring
const PARENT_ID = 'my_parent_column';
const NEST_LEFT = 'my_left_column';
const NEST_RIGHT = 'my_right_column';
const NEST_DEPTH = 'my_depth_column';
}