PHPackages                             vergil-lai/node-categories - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vergil-lai/node-categories

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vergil-lai/node-categories
==========================

Node categories model and observer for laravel 5

v1.1.4(9y ago)215744[3 issues](https://github.com/vergil-lai/node-categoires/issues)MITPHPPHP &gt;=5.5.9

Since May 16Pushed 9y ago6 watchersCompare

[ Source](https://github.com/vergil-lai/node-categoires)[ Packagist](https://packagist.org/packages/vergil-lai/node-categories)[ RSS](/packages/vergil-lai-node-categories/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (4)Used By (0)

node-categories
===============

[](#node-categories)

Node categories model and observer for laravel 5

Install
=======

[](#install)

```
 composer require vergil-lai/node-categories

```

Configure
=========

[](#configure)

在你的项目目录`config/app.php`的`providers`数组里加入:

```
VergilLai\NodeCategories\NodeCategoriesProvider::class

```

使用说明
====

[](#使用说明)

运行artisan
---------

[](#运行artisan)

创建migration并运行migrate:

```
$ php artisan node-categories:migration

```

默认的数据表名是`categories`，如果需要指定数据表名，需要加上参数`--table`，例如：

```
$ php artisan node-categories:migration --table=mytable

```

创建模型
----

[](#创建模型)

使用artisan创建模型，例如：

```
$ php artisan make:model Cateory

```

然后，让你的模型use trait `NodeCategoryTrait`

```
