laravel-eloquent-tags maintained by zing
Description
Manage tags for Laravel eloquent
Author
Last update
2026/03/18 17:07
(3.x-dev)
License
Downloads
491
Tags
Last update
2026/03/18 17:07
License
Require
- php ^8.0
- illuminate/database ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
- illuminate/support ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
Last update
2026/03/18 17:07
License
Require
- php ^8.0
- illuminate/database ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
- illuminate/support ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0
Last update
2025/02/24 16:37
License
Require
- php ^8.0
- illuminate/database ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
- illuminate/support ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
Last update
2024/03/18 15:37
License
Require
- php ^8.0
- illuminate/database ^8.0 || ^9.0 || ^10.0 || ^11.0
- illuminate/support ^8.0 || ^9.0 || ^10.0 || ^11.0
Last update
2023/02/26 15:48
License
Require
- php ^8.0
- illuminate/database ^8.0 || ^9.0 || ^10.0
- illuminate/support ^8.0 || ^9.0 || ^10.0
Last update
2023/02/01 15:35
License
Require
- php ^8.0
- illuminate/database ^8.0 || ^9.0 || ^10.0
- illuminate/support ^8.0 || ^9.0 || ^10.0
Last update
2022/11/05 14:05
License
Require
- php ^8.0
- illuminate/database ^8.0 || ^9.0
- illuminate/support ^8.0 || ^9.0
Last update
2022/08/27 16:32
License
Require
- php ^7.3 || ^8.0
- illuminate/database ^8.0 || ^9.0
- illuminate/support ^8.0 || ^9.0
Last update
2022/08/26 16:21
License
Require
- php ^7.3 || ^8.0
- illuminate/database ^8.0 || ^9.0
- illuminate/support ^8.0 || ^9.0
Last update
2022/08/26 16:21
License
Require
- php ^7.3 || ^8.0
- illuminate/database ^8.0 || ^9.0
- illuminate/support ^8.0 || ^9.0
Last update
2022/08/25 16:05
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0 || ^9.0
- illuminate/support ^6.0 || ^7.0 || ^8.0 || ^9.0
Last update
2022/02/09 07:06
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0 || ^9.0
- illuminate/support ^6.0 || ^7.0 || ^8.0 || ^9.0
Last update
2022/01/13 13:00
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0 || ^9.0
- illuminate/support ^6.0 || ^7.0 || ^8.0 || ^9.0
Last update
2022/01/01 10:17
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/12/30 04:58
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/12/27 05:15
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/11/29 04:10
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/11/29 04:10
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/11/25 09:42
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/10/16 01:15
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/07/21 13:25
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/07/21 13:25
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2021/01/08 17:50
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2020/11/23 07:31
License
Require
- php ^7.2 || ^8.0
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2020/10/17 06:03
License
Require
- php ^7.2
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2020/10/17 05:54
License
Require
- php ^7.2
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2020/10/17 05:08
License
Require
- php ^7.2
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2020/10/17 04:36
License
Require
- php ^7.2
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Last update
2020/10/16 19:22
License
Require
- php ^7.2
- illuminate/database ^6.0 || ^7.0 || ^8.0
- illuminate/support ^6.0 || ^7.0 || ^8.0
Laravel Eloquent Tags
Requires PHP 8.0+
Require Laravel Eloquent Tags using Composer:
composer require zing/laravel-eloquent-tags
Usage
use Zing\LaravelEloquentTags\Tests\Models\Product;
use Zing\LaravelEloquentTags\Tag;
$product = Product::query()->first();
// Add tag(s) to model
$product->attachTag("tag");
$product->attachTags([
"tag",
Tag::query()->first()
]);
// Remove tag(s) from model
$product->detachTag("tag");
$product->detachTags([
"tag",
Tag::query()->first()
]);
// Reset tags of model
$product->syncTags([
"tag",
Tag::query()->first()
]);
// Get tags of model
$product->tags;
// Eager load tags
$products = Product::query()->with('tags')->withCount('tags')->get();
$products->each(function (Product $product){
$product->tags->dump();
$product->tags_count;
});
// Query by tag
Product::query()->withAnyTags(['tag', 'github'])->exists(); // true
Product::query()->withAllTags(['tag', 'github'])->exists(); // false
License
Laravel Eloquent Tags is an open-sourced software licensed under the MIT license.