Laravel Enum Group package is a simple collection wrapper around Ben Sampsons awesome laravel-enum -package. It's good to have a way to combine subsets of the enums to different kind of groups for additional checks etc and here Enum Group package helps
Add composer.json:
require: {
...
"laravel-enum-group": "^1.0",
}
"repositories": [
{
"type": "vcs",
"url": "https://github.com/SPLCompanyOy/laravel-enum-group"
}
],
You can install the package via composer:
composer require splcompanyoy/laravel-enum-group
use \EnumGroup;
$editableInvoiceStatuses = EnumGroup::get('invoice.editable');
$invoiceStatus = InvoiceStatus::SENT();
if ($editableInvoiceStatuses->has($invoiceStatus)) {
$invoice::fill($input);
$invoice->save();
}
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.