laravel/serializable-closure
Securely serialize and unserialize PHP closures with Laravel’s maintained fork of opis/closure 3.x, updated for modern PHP without requiring FFI. Wrap closures in SerializableClosure, set a secret key, and safely persist or transport executable callbacks.
serialize() fails for closures.Use this when:
secretKey to prevent tampering).Look elsewhere if:
serialize() suffices.For Executives: "This package lets us safely store and restore closures—like dynamic business logic or user-specific rules—in queues, caches, or databases. It’s a drop-in solution for Laravel, reducing custom dev work and future-proofing our stack for PHP 8.5+. The MIT license and Laravel’s backing mean low risk."
For Engineers:
*"Leverage SerializableClosure to:
Bus::chain).fn(): array => $user->permissions) in Redis without losing context.secretKey to prevent tampering.opis/closure (less Laravel-integrated)."*How can I help you explore Laravel packages today?