kpebedko22 / laravel-enum
This package is abandoned and no longer maintained.
No replacement package was suggested.
Enum implementation
v0.0.2
2023-08-09 14:54 UTC
Requires
- php: ^8.0
- illuminate/console: ^9.0|^10.0
- illuminate/contracts: ^9.0|^10.0
- illuminate/database: ^9.0|^10.0
- illuminate/support: ^9.0|^10.0
Requires (Dev)
- orchestra/testbench: 8.x-dev
- phpunit/phpunit: ^10.3@dev
README
Installation
composer require kpebedko22/laravel-enum
Commands
Make Enum Command
There is a command for creating enum classes in app\Enums\
folder:
php artisan make:enum {name} {--W|wizard}
For example:
php artisan make:enum TestEnum -W
Option -W
is responsible for questions during creating enum class. User will be asked for:
- Constants (separated by comma)
- Primary key type (int / string)
- Primary key name (e.g. 'id', 'key')
- Fillable attributes (separated by comma)
Publishing stub
php artisan vendor:publish --tag=enum-package-stubs
Publishing translations
If you wish to translate the package, you may publish the language files using:
php artisan vendor:publish --tag=enum-package-translations