marc-mabe/php-enum
Native PHP enum implementation via an abstract base class. Extend it to define enumerations from public constants (supports scalars, null, and arrays), create and compare enum instances, and keep a strict set of named values for safer domain modeling.
Architecture fit is marginal due to Laravel 8+ having native enum support via BackedEnum and Stringable interfaces, making this package largely redundant for modern Laravel applications. For legacy Laravel versions (<8), it could provide enum functionality but requires manual integration with Eloquent casting. Integration feasibility is high for Composer installation but low for seamless compatibility with Laravel's built-in enum features. Technical risks include zero dependents (indicating low community adoption), potential singleton pattern conflicts with Laravel's container, and serialization issues requiring explicit trait usage. Key questions: Does the project use Laravel >=8? If yes, why not leverage native enums? How will this interact with Eloquent's enum casting? What's the migration path for existing enum constants?
Stack fit is poor for modern Laravel due to overlapping functionality with Laravel's native enum system. Laravel's built-in enums handle database casting, validation, and type safety more robustly without third-party dependencies. Migration path would require replacing existing enum constants with this package's implementation, but it's strongly recommended to migrate to Laravel's native enums instead (via enum casting in models). Compatibility is questionable
How can I help you explore Laravel packages today?