michielkempen / laravel-enum
1.0.1
2021-03-04 20:27 UTC
Requires
- php: ^7.3|^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
This package is auto-updated.
Last update: 2026-03-05 07:12:09 UTC
README
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.