Taxonomy for your content

dev-master / 1.0.x-dev 2016-01-02 17:59 UTC

This package is auto-updated.

Last update: 2021-01-11 20:22:51 UTC


Latest Version Software License Build Status Coverage Status Quality Score Total Downloads

This is a subtree split of RocketPropelledTortoise CMS - Core. Don't send pull requests here

What is it ?

Taxonomy is the art of classifying things. The Taxonomy Component is here to help you classify your content.

Create as many vocabularies and terms that you want and assign them to content.

Vocabularies can be Regions, Countries, Tags, Categories.
A vocabulary contains terms, each term can have one or more sub-terms.

Taxonomy is a Laravel 5 module


use Taxonomy;
use Model;

use Rocket\Taxonomy\TaxonomyTrait;
use Rocket\Translation\Model\Language;
use Schema;

class Post extends Model {

    // add the taxonomy trait
    use TaxonomyTrait;

    public $fillable = ['content'];

Vocabulary::insert(['name' => 'Tag', 'machine_name' => 'tag', 'hierarchy' => 0, 'translatable' => true]);

// create the post
$post = new Post(['content' => 'a test post']);

// add the tags to it
$ids = T::getTermIds(['tag' => ['TDD', 'PHP', 'Add some tags']]);

// get the tags from the Post
$terms = $post->getTerms('tag')


Install with composer : composer require rocket/taxonomy

Service Provider

You need to add both the Taxonomy and Translation Service Providers



'I18N' => '\Rocket\Translation\Support\Laravel5\Facade',
'Taxonomy' => '\Rocket\Taxonomy\Support\Laravel5\Facade',


php artisan migrate --path Translation/migrations
php artisan migrate --path Taxonomy/migrations