Package Data | |
---|---|
Maintainer Username: | oniice |
Maintainer Contact: | team@myerscode.com (myerscode) |
Package Create Date: | 2018-12-13 |
Package Last Update: | 2023-09-27 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-23 03:10:19 |
Package Statistics | |
---|---|
Total Downloads: | 4,415 |
Monthly Downloads: | 69 |
Daily Downloads: | 5 |
Total Stars: | 8 |
Total Watchers: | 3 |
Total Forks: | 2 |
Total Open Issues: | 0 |
A package for creating taxonomies and terms to categorise Eloquent models
This package allow you to create taxonomies and terms and relate them to Laravel models, similar to WordPress
Unlike other popular tag packages for Laravel this one supports MariaDB.
You can install this package via composer:
composer require myerscode/laravel-taxonomies
If using Laravel 5.5 or above, the service provider will automatically be registered.
If using Laravel 5.4 add Myerscode\Laravel\Taxonomies\ServiceProvider
to the providers
array in config/app.php
Publish the migration with:
php artisan vendor:publish --provider="Myerscode\Laravel\Taxonomies\ServiceProvider" --tag="migrations"
After the migration has been published, run the migrations to create the tags
, taxonomies
and taggables
tables.
To make an Eloquent model taggable just add the \Myerscode\Laravel\Taxonomies\HasTaxonomy
trait to it:
class Post extends Model
{
use \Myerscode\Laravel\Taxonomies\HasTaxonomy;
...
}
Are the meta tags you want to add to your model, giving them a definable characteristic.
Are are a way of grouping your terms together, categorising your collection.
For example a Taxonomy
called Colours
could contain terms such as Red
, Yellow
, Green
and Blue
.
You can get translated names from your terms and taxonomies by setting localised language files.
You can change the default Taxonomy
or Term
class by publishing the config, and modifying the classes to your custom models.
Publish the config file with:
php artisan vendor:publish --provider="Myerscode\Laravel\Taxonomies\ServiceProvider" --tag="config"
The MIT License (MIT). Please see License File for more information.