Package Data | |
---|---|
Maintainer Username: | delatbabel |
Maintainer Contact: | del@babel.com.au (Del) |
Package Create Date: | 2016-02-02 |
Package Last Update: | 2017-07-14 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-11 15:10:57 |
Package Statistics | |
---|---|
Total Downloads: | 1,370 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 3 |
Total Watchers: | 3 |
Total Forks: | 2 |
Total Open Issues: | 0 |
A Laravel 5 package for adding one or more types of category hierarchy to a website.
e.g. a hierarchy for blog categories and another for product categories
This is a Laravel 5 reimplementation of Laravel 4 Categories
categories
tableAdd these lines to your composer.json file:
"require": {
"delatbabel/nestedcategories": "~1.0"
},
Once that is done, run the composer update command:
composer update
Alternatively just run this command:
composer require delatbabel/nestedcategories
After composer update completes, add this line to your config/app.php file in the 'providers' array:
Delatbabel\NestedCategories\NestedCategoriesServiceProvider::class
Publish the migrations
php artisan vendor:publish
Run the migration
php artisan migrate
Ensure the categories types
are set correctly in the seeder file. You can initialise this to
whatever you like.
Run the seed (this will create root nodes for each of your category types
)
php artisan db:seed --class="CategoriesTableBaseArraySeeder"
You may prefer to build your own CategoriesTableSeeder class based on the code in CategoriesTableBaseArraySeeder to seed your own initial set of categories.
This class relies on the behind-the-scenes capabilities of Baum. For details on the use of that see the README on github or the Baum web site