The code uses polymorphic relations, which allows for simple but robust implementation of categories on any model you might have in your application.
$ composer require oleaass/laravel-categories
use OleAass\Categories\HasCategories;
class Product extends Model
{
use Categorizable;
}
I spend my free time making packages. So if you want to support me and my work, I would really appreciate if you bough me a coffee.
How can I help you explore Laravel packages today?