michielkempen / laravel-enum
Installs: 14 730
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^7.3|^8.0
Requires (Dev)
- orchestra/testbench: ^6.0
This package is auto-updated.
Last update: 2024-11-05 04:18:24 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.