承接 amalikov/taggy 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

amalikov/taggy

Composer 安装命令:

composer require amalikov/taggy

包简介

An Eloquent tagging package for laravel

README 文档

README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

An Eloquent tagging package for Laravel

Installation

Install the package through Composer.

Run the Composer require command from the Terminal:

composer require amalikov/taggy

The final steps for you are to add the service provider of the package and alias the package. To do this open your config/app.php file.

Amalikov\Taggy\TaggyServiceProvider::class

Go to the terminal in folder that you are migrate the tags and taggable tables:

php artisan migrate

Usage

Add the TaggableTrait trait to a model you like to use tags on.

use Amalikov\Taggy\TaggableTrait;

class YourEloquentModel extends Model
{
    use TaggableTrait;
}

Create a tags data for table that you use for example in controller or whatever place you want:

use Illuminate\Support\Str;

$tags = Tag::create([
 'name' => 'Tag Name',
 'slug' => Str::slug('Tag Name')
]);

You just need to pass the data that working with the models

$model = new YourEloquentModel;
$model->title = 'Test';
$model->save();

Set a new tags

You can set a new tags like this:

$model->tag(['your_tag_name']);

Untag existing tags

You can untag existing tag

$model->untag(['your_tag_name']);

Untag all tags

$model->untag();

Retag existing tag

$model->retag(['your_tag_name']);

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-11-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固