laravel-enum maintained by michielkempen
Author
Last update
2021/03/04 21:27
(dev-master)
License
Downloads
14 733
Tags
Laravel Enum
A strongly typed enum class for PHP that supports autocompletion and refactoring.
Installation
Add the package to the dependencies of your application
composer require michielkempen/laravel-enum
Usage
<?php
use MichielKempen\LaravelEnum\Enum;
class ExampleEnum extends Enum
{
const TYPE_A = 'a';
const TYPE_B = 'b';
const TYPE_C = 'c';
}
<?php
ExampleEnum::TYPE_A; // outputs 'a'
ExampleEnum::TYPE_B; // outputs 'b'
ExampleEnum::all(); // outputs ['a', 'b', 'c']
Security
If you discover any security related issues, please email kempenmichiel@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.