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

This package is auto-updated.

Last update: 2024-02-09 16:05:00 UTC


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