PHPackages                             mayoz/laravel-categorizable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mayoz/laravel-categorizable

ActiveLibrary

mayoz/laravel-categorizable
===========================

Polymorphic categorizable for Laravel

1.0.1(8y ago)4155MITPHPPHP ^7.0

Since Aug 1Pushed 8y ago2 watchersCompare

[ Source](https://github.com/mayoz/laravel-categorizable)[ Packagist](https://packagist.org/packages/mayoz/laravel-categorizable)[ RSS](/packages/mayoz-laravel-categorizable/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Laravel Categorizable
=====================

[](#laravel-categorizable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4e8142a38e54dd90b67b1ed6b51e10671943c4cfd6295a8fd6ab0868600b03f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61796f7a2f6c61726176656c2d63617465676f72697a61626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mayoz/laravel-categorizable)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/568918187b3071fceb61eece3e2881385ee3b4537db7b03e10d37359b01430c6/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d61796f7a2f6c61726176656c2d63617465676f72697a61626c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/mayoz/laravel-categorizable)[![StyleCI](https://camo.githubusercontent.com/843de215ae52085071c054a80c1eba3a608fe3af6f299eaddfd369d4ee46797b/68747470733a2f2f7374796c6563692e696f2f7265706f732f37313333353432372f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/71335427)

Easily add the ability to category your Eloquent models in Laravel 5.

- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Extending](#extending)
- [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require mayoz/laravel-categorizable
```

Register the service provider in your `config/app.php` configuration file:

```
'providers' => [
    ...
    Mayoz\Categorizable\CategorizableServiceProvider::class,
    ...
];
```

You can publish the migration with:

```
php artisan vendor:publish --provider="Mayoz\Categorizable\CategorizableServiceProvider" --tag="migrations"
```

The migration has been published you can create the `categories` and `categorizable` tables. You are feel free for added new fields that you need. After, run the migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

Suppose, you have the `Post` model as follows:

```
