Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Msgpack Laravel Package

smmehdisharifi/laravel-msgpack

A Laravel integration for MessagePack, the compact binary serialization format. Encode and decode MessagePack data in PHP/Laravel apps for smaller payloads and efficient data exchange, with framework-friendly helpers and configuration.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API payload efficiency as a roadmap initiative: v2.2.0 makes MessagePack a first-class citizen for Laravel JSON resources and resource collections, so shrinking response size for high-traffic endpoints becomes a supported, low-risk path rather than a custom engineering project.
  • Build vs. buy: The "build" option (hand-rolled binary serializer, custom middleware, manual pagination re-shaping) is now clearly dominated by adopting this package — it preserves data, links, and meta across offset- and cursor-based pagination, which is exactly where in-house solutions typically break.
  • Client-platform segmentation decisions: Compact binary responses matter most for mobile, IoT, and bandwidth-constrained or metered clients. This release gives a concrete lever for deciding which API tiers should negotiate MessagePack vs. stay on JSON.
  • Contract stability for public/partner APIs: Preservation of response status and custom headers in response()->msgpack(), with explicit macro arguments remaining authoritative, means teams can adopt binary responses without rewriting error/status conventions or header-based contracts.
  • Prioritization evidence: The new JSON-vs-MessagePack Laravel benchmark article and improved README onboarding give PMs the data and the adoption story needed to justify (or defer) investment with real numbers instead of vendor claims.
  • Risk posture for the roadmap: No breaking changes to HTTP negotiation or serialization behavior, no new runtime dependencies, and support across Laravel 9.x–12.x and PHP 8.1–8.4 mean this can be scheduled alongside normal maintenance rather than as a risky migration.

When to Consider This Package

Consider adopting when:

  • You run Laravel 9.x–12.x on PHP 8.1–8.4 and serve JSON APIs where response size or egress cost is material.
  • Your clients (mobile apps, embedded, high-volume service-to-service) can consume MessagePack and you want content negotiation rather than a hard cutover — the package explicitly supports negotiation alongside JSON.
  • You rely on Laravel API resources, including paginated resources, and need data/links/meta intact — the core value of this release.
  • You need status codes and custom headers preserved on binary responses (e.g., rate-limit, cache, or tracing headers) without bypassing the macro.
  • You want a low-friction pilot: no new runtime dependencies, no breaking changes, and a published benchmark to validate the upside before committing.

Look elsewhere / defer when:

  • Responses must remain human-readable in browser or curl-based debugging workflows, or your consumers are third-party integrators who won't adopt a binary content type.
  • Your payloads are small or already compressed at the edge (gzip/brotli), where MessagePack's marginal gain may not justify client-side work.
  • You're on Laravel versions or PHP runtimes outside the supported matrix.
  • You need a mature, widely-adopted ecosystem with extensive third-party tooling — this is a focused package with a small maintainer surface (recent PR #12 / issue #13 activity), so weigh bus-factor and long-term support expectations accordingly.

How to Pitch It (Stakeholders)

For executives: This is a low-risk, no-new-dependency upgrade that lets our Laravel APIs return more compact binary responses to clients that can use them, while keeping JSON for everyone else. The business case is straightforward — smaller payloads translate to lower bandwidth/egress cost and faster responses on mobile and constrained networks. There are no breaking changes, it works across the Laravel and PHP versions we already run, and there's a published benchmark to size the benefit before we commit. Recommended next step: a contained pilot on one high-traffic endpoint to quantify savings.

For engineering: v2.2.0 adds first-class MessagePack support for JSON resources and resource collections, correctly preserving data, links, and meta for both offset- and cursor-based pagination. response()->msgpack() now carries through resource status codes and custom headers, with explicit macro arguments still taking precedence — so existing contracts don't shift. Compatibility is unchanged (PHP 8.1–8.4, Laravel 9–12), there are no new runtime dependencies, and the release is validated by 52 tests / 191 assertions across the full PHP matrix plus strict Composer validation. Adoption is opt-in via existing HTTP negotiation, so we can roll out per-endpoint and roll back trivially.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox