Download the PHP package trexology/taxonomy without Composer
On this page you can find all versions of the php package trexology/taxonomy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package taxonomy
Taxonomy
This package allows you to create vocabularies with terms in Laravel 4 and 5
Installation
Laravel 5
In your composer.json
add:
"require": {
"trexology/taxonomy": "3.*"
}
From the terminal run
composer update
Then register the service provider and Facade by opening app/config/app.php
(Skip this step if you are on laravel 5.5)
Then run the following artisant command to publish the config and migrations:
php artisan vendor:publish
Then run the migrations:
php artisan migrate
And finally in any of the Models where you want to use the Taxonomy functionality, add the following trait:
Laravel 4
In your composer.json
add:
"require": {
"trexology/taxonomy": "2.0.*"
}
From the terminal run
composer update
Then register the service provider and Facade by opening app/config/app.php
If you want you can publish the config files if you want to change them
php artisan config:publish trexology/taxonomy
Perform the DB migrations to install the required tables
php artisan migrate --package=trexology/taxonomy
And finally in any of the Models where you want to use the Taxonomy functionality, add the following trait:
Usage
Creating a vocabulary:
Retrieving a Vocabulary:
Deleting a Vocabulary:
Adding a Term to a vocabulary:
You can also optionally specify a parent term and a weight for each, so you can group them together and keep them sorted:
If terms contains additional params, it can be added in this manner:
With the Car Model, I can create a new instance and assign it a term for the make it belongs to:
To retrieve all the cars that match a given term:
Add these lines to your routes file, to access the UI for managing terms/vocabulary
Extend UI with your current admin theme by changing the configuration in taxonomy.config.php