lecturize/laravel-tags
Larablocks Analysis
lecturize/laravel-tags works with Laravel 9 and 10 (latest release v1.1.0, Feb 21, 2023), all past end of life (the last on Feb 4, 2025): no more fixes, even for security.
Laravel 5 to 8 in earlier releases.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 9 and 10, past end of life since Feb 4, 2025
- No release in the last 12 months (last: Feb 21, 2023)
- 0 downloads a month (needs 10,000)
- 7 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Feb 21, 2023.
- No releases in the last 12 months.
- First released: Sep 3, 2015.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 26, 2026.
| Install | |
|---|---|
composer require lecturize/laravel-tags |
|
| Latest Version: | v1.1.0 |
| PHP: | ^8.0 |
| Laravel: | 9 · 10 |
| Older releases: | 5 – 8 |
| License: | MIT |
| Last Updated: | Feb 21, 2023 |
| Links: | GitHub · Packagist |
Laravel Tags
Simple way to tag eloquent models in Laravel.
Installation
Require the package from your composer.json file
"require": {
"lecturize/laravel-tags": "^1.0"
}
and run $ composer update or both in one with $ composer require lecturize/laravel-tags.
Configuration & Migration
$ php artisan vendor:publish --provider="Cviebrock\EloquentSluggable\ServiceProvider"
$ php artisan vendor:publish --provider="Lecturize\Tags\TagsServiceProvider"
This will publish a config/sluggable.php, a config/lecturize.php and some migration files, that you'll have to run:
$ php artisan migrate
For migrations to be properly published ensure that you have added the directory database/migrations to the classmap in your projects composer.json.
Usage
First, add our HasTags trait to your model.
<?php
namespace App\Models;
use Lecturize\Tags\Traits\HasTags;
class Post extends Model
{
use HasTags;
// ...
}
?>
Get all tags for a model
$tags = $model->tags();
Check if model is tagged with a given tag
$tags = $model->hasTag('Check');
Add one or more tags
$tags = $model->tag('My First Tag');
$tags = $model->tag(['First', 'Second', 'Third']);
Remove given tags from model
$tags = $model->untag('Remove');
Replace all existing tags for a model with new ones
$tags = $model->retag('A New Tag');
$tags = $model->retag(['Fourth', 'Fifth', 'Sixth']);
Remove all existing tags from model
$tags = $model->detag();
Get a list of all tags
$tags = $model->listTags();
This is a convenience method for $model->tags->pluck('tag')
Scopes
There are two scopes included to fluently query models (e.g. Posts) with given tags.
$posts = Post::withTag('My First Tag')->get();
$posts = Post::withTags(['First', 'Second', 'Third'])->get();
License
Licensed under MIT license.
Author
Handcrafted with love by Alexander Manfred Poellmann in Vienna & Rome.
Alternatives to lecturize/laravel-tags
Use PHP traits to extend Laravel Eloquent Models to allow Tags. Models can be ma...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.1.0 | ^8.0 | ^9.0| | MIT | |
| v1.0.1 | ^7.2.5| | ^6.0| | MIT | |
| v1.0.0 | ^7.2.5| | ^6.0| | MIT | |
| v0.1.1 | >=7.2 | >=6.0 | MIT | |
| v0.1.0 | >=5.6.4| | >=5.3 | MIT | |
| v0.0.1 | >=5.5.9 | >=5.1 | MIT |