thunderid / eloquent-tree-model
eloquent tree structured model
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/thunderid/eloquent-tree-model
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-10-11 22:09:28 UTC
README
#Attributes
name : name of the node
tree_path : path of the node
tree_path_delimiter : delimiter of the path
#Usage
- Create a model class
- Add this code to your model:
use \ThunderID\EloquentTreeModel\ITreeModel;
use \ThunderID\EloquentTreeModel\TreeModelTrait;
use \ThunderID\EloquentTreeModel\TreeModelObserver;
- Update your model to implements ITreeModel
class MyModel extends Model implements ITreeModel
- Use TreeModel trait in your model
use TreeModelTrait;
- Assign observer to your model
static::observe(new TreeModelObserver);