websystem/tags 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

websystem/tags

最新稳定版本:v0.0.2

Composer 安装命令:

composer require websystem/tags

包简介

Add tags and taggable behaviour to your Laravel app

README 文档

README

Overview Lara-tags

Latest Version on Packagist MIT Licensed Total Downloads

Installation

Install the package through Composer.

Run the Composer require command from the Terminal:

composer require websystem/tags

After that, you need to run migrations.

php artisan migrate

Usage

Here are some code examples:

// apply HasTags trait to a model
use Illuminate\Database\Eloquent\Model;
use Websystem\Tags\HasTags;

class Lesson extends Model
{
    use HasTags;

    // ...
}
// create a model tag
use Illuminate\Support\Str;

$tags = Tag::create([
 'name' => 'Tag Name',
 'slug' => Str::slug('Tag Name')
]);
// create a model lesson ex.
$lesson = Lesson::create([
 'title' => 'Lesson Title',
]);

Set a new tags

Attaching tags

$lesson->tag(['your_tag_name', '...']);

Untag

Detaching tags

// detach a tag
$lesson->untag(['your_tag_name', '...']);

// detach all tags
$lesson->untag();

Retag

Retaging tags

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固