thunderid/eloquent-tree-model

此包最新版本(dev-master)没有提供许可证信息。

eloquent树结构模型

dev-master 2015-03-17 01:36 UTC

This package is not auto-updated.

Last update: 2024-09-14 16:34:43 UTC


README

#属性

name				: name of the node
tree_path			: path of the node
tree_path_delimiter	: delimiter of the path

#用法

  • 创建模型类
  • 将此代码添加到您的模型中
use \ThunderID\EloquentTreeModel\ITreeModel;
use \ThunderID\EloquentTreeModel\TreeModelTrait;
use \ThunderID\EloquentTreeModel\TreeModelObserver;
  • 更新您的模型以实现ITreeModel接口
class MyModel extends Model implements ITreeModel 
  • 在您的模型中使用TreeModel特性
use TreeModelTrait;
  • 为您的模型分配观察者
static::observe(new TreeModelObserver);