- How do I install laravel-magic-enums in a Laravel app?
- Install it with Composer using composer require synergitech/laravel-magic-enums. It is a standard Composer-based Laravel package and does not require new infrastructure. After installation, review the README for any configuration or publishing steps and run your application test suite.
- Does laravel-magic-enums support Laravel 13?
- Yes, v3.0.4 adds Laravel 13 support, which is an important compatibility signal for upgrade planning. You should still confirm the exact PHP and Laravel constraints in the package composer.json before upgrading. Test the package in a branch against your application dependency tree before production rollout.
- What features does laravel-magic-enums add to PHP enums?
- The package adds helpers such as labels, descriptions, validation rules, model casts, select options, fluent methods, and frontend type definitions. These features make enums more expressive and reduce custom enum plumbing in Laravel applications. They are useful for fields such as status, type, role, or category.
- Can I use laravel-magic-enums for model casts and validation rules?
- Yes, the package is intended for enum-backed model attributes, casting, validation, and serialization. It helps standardize fields like status, type, role, or category without writing bespoke enum handling. Validate casting, validation, serialization, and persistence behavior in your own test suite.
- How does laravel-magic-enums help with frontend type definitions?
- The package lets you use enums in your frontend with type definitions, helping keep backend enum values aligned with frontend types. This can reduce mismatch between Laravel enum values and client-side definitions. Review any build or publish steps in the README because Node and NPM changes mentioned in the release are development tooling only.
- Is laravel-magic-enums compatible with PHPStan?
- v3.0.4 adds PHPStan v1.x support, which can reduce friction in static-analysis-enabled CI pipelines. You should review dependency alignment with your existing PHPStan version and CI configuration. Define the intended PHPStan integration scope before relying on it across the project.
- Does the token boundary fix in v3.0.4 change enum parsing or validation behavior?
- The release notes mention a token boundary fix, so you should validate existing enum string values if the package is used for parsing or validation. The release is patch-level with no obvious breaking changes in the notes, but behavioral regressions around token boundaries are the main risk. Run enum-focused regression tests and pin v3.0.4 during rollout.
- What are the migration steps from v3.0.3 to v3.0.4?
- Pin v3.0.4, update dependencies in a branch, and run the full test suite. Specifically exercise enum casting, validation, serialization, and any token-boundary-sensitive inputs. No explicit migration notes are provided in the context, so treat it as a patch update but verify behavior before production.
- Is laravel-magic-enums safe for production and scaling?
- Runtime risk is low because enum casting and validation are in-process, and the package introduces no meaningful scaling concern. If enums persist as string columns, make sure indexing and query patterns remain appropriate. Use staged rollout, regression tests, and a pinned rollback version for production safety.
- How actively maintained is laravel-magic-enums and what alternatives should I consider?
- v3.0.4 signals active maintenance and Laravel 13 readiness, but the project release cadence and long-term maintenance posture are not detailed in the provided context. Track upstream releases, keep the Composer lockfile under version control, and schedule dependency updates. Alternatives include native PHP enums with custom helper methods or other enum packages, evaluated against your Laravel, PHPStan, and frontend typing needs.