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

Buffer Laravel Package

phpinnacle/buffer

A lightweight PHP library for working with binary data, offering a fluent Buffer API to read and write integers, strings, floats, and more. Useful for protocol clients, parsers, and AMQP-style message handling.

Deep Wiki
Context7

Simple library for operating binary data in PHP

Frequently asked questions about Buffer
What is phpinnacle/buffer used for in a Laravel application?
It is a small, framework-agnostic byte buffer for reading and writing binary data through a fluent API. In a Laravel app it fits infrastructure code such as AMQP/RabbitMQ frame encoding, custom TCP or UDP protocol clients, Redis protocol tooling, or fixed-width record serialization. It is not a general-purpose serializer and is not tied to Eloquent or JSON. Keep it in a support or codec layer rather than in domain code.
How do I install phpinnacle/buffer with Composer?
Run composer require phpinnacle/buffer in your project. The package is MIT-licensed and has no runtime dependencies beyond PHP itself, so no extra extensions or service providers are required. Because the upstream repository is not verifiable, consider pinning a specific commit or vendoring an audited copy instead of relying on a floating tag.
Does phpinnacle/buffer support Laravel 10, 11, and PHP 8.2 to 8.4?
The library is framework-agnostic, so it has no Laravel version constraint and can be used in Laravel 10, 11, or newer as long as your PHP version is supported. The last listed release is from January 2021, so it predates PHP 8.2 to 8.4 and may emit deprecation warnings. Check the composer.json PHP constraint and run your test suite on each target PHP version before adopting it.
Do I need to register a service provider or publish config for phpinnacle/buffer?
No. The package has no service container bindings, configuration files, or framework coupling. You simply instantiate the buffer class where you need it and use its read and write methods. For maintainability, wrap it behind your own first-party codec interface instead of injecting vendor classes throughout the app.
How does phpinnacle/buffer handle endianness for integers and floats?
The typed accessors accept configurable endianness, which lets you match the byte order required by the wire protocol you are implementing. You should confirm the behavior against golden byte vectors on your actual targets, especially if your fleet mixes little-endian x86 or ARM hosts with any big-endian systems. Endianness is the main compatibility axis to test when porting pack and unpack logic to the buffer API.
Can phpinnacle/buffer read and write 64-bit integers on 32-bit PHP?
64-bit integer handling on 32-bit PHP is a known hard problem for all binary libraries, and the available documentation does not make specific guarantees. Treat signed and unsigned 64-bit values as a case to verify explicitly with boundary tests if any of your targets run 32-bit PHP. If you cannot verify the behavior, keep 64-bit fields behind your own codec abstraction so they can be swapped or reimplemented.
How do I seek, rewind, or check the current read position in phpinnacle/buffer?
The buffer tracks its own offset automatically, so sequential reads and writes do not require manual position math. It also exposes seek and rewind operations for random access within the byte stream, which is useful for patching length prefixes or re-reading a header. Consult the package source for the exact method names before relying on them in production code.
What are alternatives to phpinnacle/buffer for binary parsing in PHP?
Raw pack and unpack calls are the built-in baseline, but they leave cursor and offset management to you. Other options include protocol-specific libraries, AMQP client packages that bundle their own codecs, or a small in-house buffer class. Since this buffer API surface is narrow, reimplementing it on top of pack and unpack is a realistic fallback if the package becomes unavailable.
Is phpinnacle/buffer safe to use in production?
The code itself is small and auditable, but the package health signals are weak: the repository cannot be verified, the last release is from January 2021, and adoption is very low. Those factors block a formal supply-chain review and suggest no ongoing maintenance or security disclosure process. The practical mitigation is to obtain and audit the source, pin or vendor it, and keep it behind an abstraction boundary you control.
How should I test binary encoding and decoding built with phpinnacle/buffer?
Use golden-vector tests: encode known values and assert the exact bytes, then decode those bytes and assert the original values round-trip. Cover endianness, signed and unsigned integer bounds, IEEE-754 float round-tripping, and offset behavior after seek and rewind. Run the same suite on every PHP version and architecture you deploy to, and keep the tests attached to your codec wrapper rather than the vendor classes.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console