Categorizable is a package for Laravel that adds the ability to categorize your models into nested categories.
From the command line, run:
composer require programmende/laravel-categorizable
For your Laravel app, open config/app.php
and, within the providers
array, append:
Programmende\Commentable\CategorizableServiceProvider::class,
This will bootstrap the package into Laravel.
Migrate the database to add the 'categories' table
php artisan migrate
With the package now installed, you may use the provided favoritable
trait in your models, like so:
<?php
namespace App;
use Programmende\Commentable\Commentable;
class Post extends Model
{
use commentable;
...
}