PHPackages                             orobogenius/laravel-model-statable - 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. [Database &amp; ORM](/categories/database)
4. /
5. orobogenius/laravel-model-statable

ActiveLibrary[Database &amp; ORM](/categories/database)

orobogenius/laravel-model-statable
==================================

Add states to your laravel models.

1.0.0(7y ago)119MITPHPPHP &gt;=5.6.4

Since Jan 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/orobogenius/laravel-model-statable)[ Packagist](https://packagist.org/packages/orobogenius/laravel-model-statable)[ Docs](https://github.com/orobogenius/laravel-model-statable)[ RSS](/packages/orobogenius-laravel-model-statable/feed)WikiDiscussions master Synced 2d ago

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

Laravel Model Statable
======================

[](#laravel-model-statable)

[![](https://camo.githubusercontent.com/2d32f302bcba1fd0f430a6ace2ca075bf82753fef33fa6ed242a54df567ab9da/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6f726f626f67656e6975732f6c61726176656c2d6d6f64656c2d7374617461626c652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/orobogenius/laravel-model-statable)[![](https://camo.githubusercontent.com/2060c2cb13fff2a806bdffe82ac18dd3cc2803a1ca4a4f3736cdc4b3c9ed42ed/68747470733a2f2f706f7365722e707567782e6f72672f6f726f626f67656e6975732f6c61726176656c2d6d6f64656c2d7374617461626c652f762f737461626c653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/orobogenius/laravel-model-statable)[![](https://camo.githubusercontent.com/4b798e20b7af4bcf543d28ea97fba520d31ef9a8689fd0c52311f7bc7d5efc4b/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6f726f626f67656e6975732f6c61726176656c2d6d6f64656c2d7374617461626c652e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/orobogenius/laravel-model-statable)[![](https://camo.githubusercontent.com/59d352dbd8a27e9c12057c37743c50e6777616fe/68747470733a2f2f7374796c6563692e696f2f7265706f732f3136343239323139362f736869656c64)](https://styleci.io/repos/167356410)[![](https://camo.githubusercontent.com/40c59da99956024b8d6b2f02215a5eeab307f470bd3fc208ef861424434b4091/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f726f626f67656e6975732f6c61726176656c2d6d6f64656c2d7374617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/orobogenius/laravel-model-statable)

This package lets you add predefined states to your laravel models. This allows you to define states that can be applied to your models at various points in your application. You can define all your states in one place and transition your model instances into different states. For example, you may define an `admin` state that transforms a user into an admin.

Contents
--------

[](#contents)

- [Installation](#installation)
- [Usage](#usage)
- [Testing](#testing)
- [License](#license)

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

[](#installation)

#### Composer

[](#composer)

To install this package via composer, simply run:

```
$ composer require orobogenius/laravel-model-statable
```

or just add:

```
"orobogenius/laravel-model-statable": "~1.0"
```

to your `composer.json` file, then run `composer install` or `composer udpate`.

Usage
-----

[](#usage)

To add states to your laravel models, add the `Orobogenius\Statable\Statable` trait to the model.

```
