art-fatal/doctrine-enum-bundle
composer require and bundle registration (if not using Symfony Flex). The make:enum command simplifies enum creation, reducing friction.DayOfWeek) can be used immediately, accelerating development.spatie/laravel-enum) that could fulfill the same need?string columns with application-level validation (e.g., for PostgreSQL/SQLite compatibility)?string with indexes?make:enum command streamline adoption.spatie/laravel-enum or myclabs/deep-copy + custom Doctrine-like types).EnumType to work with Laravel’s Eloquent.make:enum command for Laravel’s artifact structure.make:enum command to generate 1–2 enums in a non-production environment.EnumType.ALTER TABLE user MODIFY status ENUM(...)).composer require art-fatal/doctrine-enum-bundle
Register the bundle in config/bundles.php (if not using Flex).make:enum for new enums or manually create EnumType classes.php bin/console make:enum
#[ORM\Column(type: UserStatusEnumType::NAME)]).php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate
isWeekend() methods).EnumType classes may require deeper debugging for edge cases (e.g., invalid values).string columns with validation if needed.- run: php bin/console doctrine:schema:validate
- run: php bin/console make:enum --dry-run # Test enum generation
| Risk | Impact | Mitigation |
|---|---|---|
| Migration Failures | Downtime if migrations fail. | Test migrations in staging; use transactions where possible. |
| Invalid Enum Values | Data corruption if enum cases change. | Use migrations to alter ENUM columns; validate data before changes. |
| Database Compatibility | ENUM columns break on non-MySQL DBs. | Use feature flags or database-specific configurations. |
| Type Safety Gaps | Custom enums bypass validation. | Enforce EnumType extension in code reviews; use static analysis tools. |
| Bundle Updates | Breaking changes in future versions. | Monitor for updates; test against new versions in CI. |
How can I help you explore Laravel packages today?