nickdekruijk/taggable
最新稳定版本:1.0.5
Composer 安装命令:
composer require nickdekruijk/taggable
包简介
Make your Laravel models taggable
README 文档
README
Taggable
Make your Laravel models taggable
Installation
composer require nickdekruijk/taggable
Config
If you don't like the default configuration edit config/taggable.php after publishing the config file with:
php artisan vendor:publish --tag=config --provider="NickDeKruijk\Taggable\ServiceProvider"
Run migration
Then run the migration
php artisan migrate
Usage
Add the Taggable trait to your model:
<?php namespace App; use Illuminate\Database\Eloquent\Model; use NickDeKruijk\Taggable\Taggable; class Product extends Model { use Taggable;
Admin package integration
If you are using nickdekruijk/admin add this to your config/admin.php file to manage tags:
'tags' => [ 'view' => 'admin::model', 'icon' => 'fa-tags', 'model' => 'NickDeKruijk\Taggable\Tag', 'index' => 'title', 'active' => 'active', 'orderBy' => 'sort', 'sortable' => true, 'treeview' => 'parent', 'columns' => [ 'active', 'title', ], ],
And add a column to the model you made taggable:
'tags' => [ 'type' => 'pivot', 'model' => 'NickDeKruijk\Taggable\Tag', 'morph' => 'taggable', 'scope' => 'getTree', 'columns' => 'title', 'treeview' => 'parent', ],
License
Admin is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 307
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-21