haakco / laravel-enum-generator
Generates simple class to act as an enum from a table specified in its con
Installs: 7 761
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/haakco/laravel-enum-generator
Requires
- php: ^8.4
- archtechx/enums: >=1.1.2
- illuminate/console: ^12.0
- illuminate/database: ^12.0
- illuminate/support: ^12.0
Requires (Dev)
- brainmaestro/composer-git-hooks: ^3.0
- brianium/paratest: *
- ergebnis/composer-normalize: ^2.48
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.6
- phpunit/phpunit: ^12.0
- roave/security-advisories: dev-latest
- symplify/coding-standard: >=13
- symplify/easy-coding-standard: >=12.6
This package is auto-updated.
Last update: 2025-11-03 13:01:00 UTC
README
This is where your description should go. Take a look at contributing.md to see a to do list.
Installation
Via Composer
$ composer require haakco/laravel-enum-generator --dev
Configuration for local environment only
If you wish to enable generators only for your local environment, you should install it via composer using the --dev option like this:
composer require haakco/laravel-enum-generator --dev
Then you'll need to register the provider in app/Providers/AppServiceProvider.php file.
public function register() { if ($this->app->environment() == 'local') { $this->app->register(\HaakCo\LaravelEnumGenerator\LaravelEnumGeneratorServiceProvider::class); } }
Usage
Copy the config over
php artisan vendor:publish --provider="HaakCo\LaravelEnumGenerator\LaravelEnumGeneratorServiceProvider"
Edit the config file enum-generator.php to specify which tables to use to generate the files.
Now run the following to re-create your models.
php artisan modelEnum:create
Change log
Please see the changelog for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email tim@haak.co instead of using the issue tracker.
Credits
License
mit. Please see the license file for more information.