Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omatech/laravel-statusable
Tired of repeating the status control of your models again and again? Well, here it's already done.
https://github.com/omatech/laravel-statusable
laravel laravel-package status status-history
Last synced: about 1 month ago
JSON representation
Tired of repeating the status control of your models again and again? Well, here it's already done.
- Host: GitHub
- URL: https://github.com/omatech/laravel-statusable
- Owner: omatech
- License: mit
- Created: 2019-03-22T16:53:56.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-06T09:43:25.000Z (about 5 years ago)
- Last Synced: 2024-08-19T02:53:26.076Z (4 months ago)
- Topics: laravel, laravel-package, status, status-history
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Statusable
[![Latest Version on Packagist](https://img.shields.io/packagist/v/omatech/laravel-statusable.svg?style=flat-square)](https://packagist.org/packages/omatech/laravel-statusable)
[![Total Downloads](https://img.shields.io/packagist/dt/omatech/laravel-statusable.svg?style=flat-square)](https://packagist.org/packages/omatech/laravel-statusable)Tired of repeating the status control of your models again and again? Well, here it's already done.
## Installation
You can install the package via composer:
```bash
composer require omatech/laravel-statusable
```## Setup
``` bash
php artisan vendor:publish --tag=laravel-statusable-publish
```
## Usage
Just use ```Statusable``` trait in your models to obtain the current status or the status history.
``` php
use Omatech\LaravelStatusable\App\Traits\Statusable;
```
To add an entry to history use the add method from ```StatusHistory``` model. Example:
``` php
StatusHistory::add('status-name', 'model-instance', 'releated-model', 'guard');
```
### Testing
``` bash
composer test
```### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.