- What is datomatic/laravel-enum-collections used for?
- It is a Laravel package that extends Laravel's Collection API to PHP enums. It lets you wrap enum cases in a collection-like object and use familiar methods such as filter, map, sort, group, pluck, and transform. This keeps enum-heavy code cleaner and more expressive without extra boilerplate.
- How do I install datomatic/laravel-enum-collections with Composer?
- Install it as a normal Composer dependency in your Laravel application, typically with composer require datomatic/laravel-enum-collections. Then confirm the package's Laravel and PHP version constraints match your composer.json. Because installation details can vary by major version, check the repository README and release notes for any service provider or configuration steps.
- Which Laravel versions are supported by laravel-enum-collections?
- The package is built for Laravel and PHP applications, and version 3.4.2 specifically addresses Laravel 13.3's changed Collection::make method definition. The available release note does not document the full supported Laravel range, so verify the composer.json constraints and CI matrix before upgrading. Teams on versions below 13.3 should confirm backward compatibility rather than assuming it.
- How do I create a collection from PHP enum cases?
- The package wraps enum cases so you can treat them as a collection instead of manually building arrays. You create the enum collection from your enum cases and then chain the supported Collection methods. Check the README for the exact class or helper name used by your installed version.
- Can I use Laravel Collection methods like filter, map, sort, group and pluck on enums?
- Yes. The package extends Laravel's Collection API to PHP enums and supports familiar methods including filter, map, sort, group, pluck, and transform. That means enum-heavy Laravel code can use chainable collection-style logic instead of custom loops and boilerplate.
- Does laravel-enum-collections v3.4.2 work with Laravel 13.2 and 13.3?
- Version 3.4.2 is a patch-level compatibility release aimed at Laravel 13.3's changed Collection::make definition. The release note does not state whether behavior is preserved on earlier supported Laravel versions such as 13.2. Confirm this with the package's tests, composer constraints, or an issue-tracker check before rolling it out across a version matrix.
- Is upgrading to laravel-enum-collections 3.4.2 a breaking change?
- It is framed as a patch-level fix for Laravel 13.3 compatibility, not a new feature release. The technical risk is low to moderate, mainly around unverified compatibility with your Laravel matrix and any custom Collection extensions. Run your application test suite and add focused tests for collection creation and manipulation before production.
- How should I test enum collections in a Laravel application?
- Add focused tests around any code path that creates or manipulates enum collections, including chained filter, map, sort, group, pluck, and transform calls. Run the full application test suite on a dedicated branch after the Composer update. If you maintain a CI matrix, include the Laravel versions you support, especially 13.2 and 13.3.
- What are alternatives to laravel-enum-collections for enum collections in Laravel?
- Alternatives include using native PHP enum methods, wrapping enum cases in a standard Laravel Collection with map or pluck, or writing small application-specific helpers. The main advantage of this package is that it provides Collection-style chaining directly for enum cases. Evaluate whether your app needs that expressiveness or whether plain collections are sufficient.
- How do I safely roll out and maintain laravel-enum-collections in production?
- Create a dedicated branch, update the package with Composer, and keep the previous composer.lock for rollback. Run CI and staging validation, then deploy to production. For ongoing maintenance, pin the dependency version, monitor upstream releases, and re-test whenever Laravel changes Collection internals or your app adds custom Collection overrides.