repat/immutability
A small PHP package for building immutable objects and value types, helping prevent accidental state changes in Laravel and plain PHP projects. Useful for safer domain models, predictable data, and cleaner code.
repat/immutability is a lightweight Laravel/PHP package for building genuinely immutable objects. Apply the provided trait to a class and its state becomes locked after construction, so any attempt to modify it later is rejected instead of silently corrupting data your application relies on.
It is a natural fit for DTOs, value objects, and configuration data where accidental mutation causes subtle bugs. The package integrates cleanly with Laravel through package auto-discovery and stays out of the way of your existing code.
How can I help you explore Laravel packages today?