haakco / laravel-enum-generator
Generates simple class to act as an enum from a table specified in its con
Installs: 2 875
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=8.0
- archtechx/enums: >=0.3
- illuminate/database: >=8
- illuminate/support: >=8
Requires (Dev)
- ergebnis/composer-normalize: >=2
- mockery/mockery: >=1
- orchestra/testbench: >=8
- phpunit/phpunit: >=9
- roave/security-advisories: dev-latest
- sempro/phpunit-pretty-print: >=1
- symplify/coding-standard: >=12
- symplify/easy-coding-standard: >=12
- dev-master
- v5.1.1
- v5.1.0
- v5.0.2
- v5.0.1
- v4.0.16
- v4.0.15
- v4.0.14
- v4.0.8
- v4.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/composer/laravel/framework-10.48.23
- dev-timhaak/master
This package is auto-updated.
Last update: 2024-11-13 11:56:24 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.