cosmira/envelope
Cosmira Envelope is a lightweight Laravel/PHP package for working with structured data envelopes. It provides a clean, expressive API to define, validate, and transform payloads, keeping application data consistent and easy to manage across services and responses.
composer require cosmira/envelope. The package requires illuminate/collections ^11.0 || ^12.0, so it works with Laravel 11 and Laravel 12 applications.0.0.1 is the first tagged release. Start by reading the package README and the src/ directory to confirm the public API — there is no prior assessment or usage history to rely on.Illuminate\Support\Collection) in a consistent envelope object before passing it between application layers or returning it from a controller.composer.json for Laravel auto-discovery before adding any manual registration.illuminate/collections, expect first-class support for wrapping and unwrapping Collection instances. Prefer collect($data) before constructing the envelope so downstream code has a consistent type.JsonResponse in one place — for example a Responsable class or a response macro — so the package is not coupled directly to every controller.0.0.x series.0.0.1 signals an unstable API. Pin the exact version in composer.json ("cosmira/envelope": "0.0.1") until you have reviewed a later release’s changelog.illuminate/collections constraint to include ^12.0 and bumps CI actions. There are no new features or fixes to evaluate — the assessment is effectively for the initial release.Illuminate\Mail\Envelope. If you use both in the same file, alias one of the imports to avoid confusing errors.illuminate/collections. Do not assume it pulls in Laravel’s full framework, a service provider, config file, or facade. Verify before expecting php artisan vendor:publish to work.dd() on the envelope or reading the source directly is often faster than searching for documentation. Check the package’s tests for intended usage examples.0.0.x class couples you to an API that may change without a major version bump.0.0.1, review the full changelog at the repository, not just Dependabot summaries. Dependency-only releases can still change minimum PHP or Laravel requirements.How can I help you explore Laravel packages today?