LaravelPackages.net
Acme Inc.
Toggle sidebar
owllog/laravel-taggy

An Eloquent tagging package for Laravel Framework.

5
0
1.0.0
About owllog/laravel-taggy

owllog/laravel-taggy is a Laravel package for an eloquent tagging package for laravel framework.. It currently has 0 GitHub stars and 5 downloads on Packagist (latest version 1.0.0). Install it with composer require owllog/laravel-taggy. Discover more Laravel packages by owllog or browse all Laravel packages to compare alternatives.

Last updated

Laravel-Taggy

An Eloquent tagging package for Laravel Framework.

Installation

Install the package via composer

$ composer require owllog/laravel-taggy

Add laravel-taggy service provider to config/app.php

/*
 * Package Service Providers...
 */
Owllog\LaravelTaggy\LaravelTaggyServiceProvider::class,

Than migrate the new tags tables to database

$ php artisan migrate

Usage

Add Taggable trait to your models:

Example:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Owllog\LaravelTaggy\Traits\Taggable;

class Lesson extends Model
{
    use Taggable;
}

Find Lesson and add tags to it:

$lesson = Lesson::find(38);

$lesson->tag(['velit', 'Rerum', 'dolorem', 'quo']);

To Get A Lesson Tags: [This relation available via taggable trait]

$lesson = \App\Lesson::find(1);
$lesson->tags();

Star History Chart