PHPackages                             memran/marwa-envelop - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. memran/marwa-envelop

ActiveLibrary[HTTP &amp; Networking](/categories/http)

memran/marwa-envelop
====================

Transport-agnostic message envelope with fluent builder for Kafka/WebSocket/etc.

v2.0.0(3mo ago)0211MITPHPPHP ^8.2CI passing

Since Aug 8Pushed 3mo agoCompare

[ Source](https://github.com/memran/marwa-envelop)[ Packagist](https://packagist.org/packages/memran/marwa-envelop)[ RSS](/packages/memran-marwa-envelop/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (3)Used By (1)

Marwa Envelop
=============

[](#marwa-envelop)

Small, framework-agnostic message envelopes for PHP applications that need a consistent payload format across Kafka, WebSocket, MQTT, queues, and internal event pipelines.

[![CI](https://github.com/memran/marwa-envelop/actions/workflows/ci.yml/badge.svg)](https://github.com/memran/marwa-envelop/actions/workflows/ci.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/426e1312413b23734d81474a2bbb63ab2f82006525c18a0b1148722c6a0e671d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d656d72616e2f6d617277612d656e76656c6f702e737667)](https://packagist.org/packages/memran/marwa-envelop)[![PHP Version](https://camo.githubusercontent.com/c6a683338f03448e78eaf7b40fd08cc1453c15d0d59fddc933e8f4915e291a44/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6d656d72616e2f6d617277612d656e76656c6f702f706870)](https://packagist.org/packages/memran/marwa-envelop)[![Packagist Downloads](https://camo.githubusercontent.com/4c115345158f7e08f7b8602e0f4a2ad39d1309346366c75a4439b2ac8bd3eafd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d656d72616e2f6d617277612d656e76656c6f702e737667)](https://packagist.org/packages/memran/marwa-envelop)[![License](https://camo.githubusercontent.com/479071cf8ffa48658e9719ba05b6099f132b917c9ef1cd648fdb91bc8151a05e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d656d72616e2f6d617277612d656e76656c6f702e737667)](LICENSE)

Marwa Envelop gives you an immutable envelope object, a fluent builder, and a codec for safe serialization, compression, and signature verification. It is designed for libraries and services that want predictable message structure without framework lock-in.

Features
--------

[](#features)

- Immutable message envelopes with a fluent builder API
- JSON serialization with explicit error handling
- Optional HMAC signing and signature verification
- Optional gzip transport encoding
- Built-in payload size limits for wire and decoded content
- File attachments and validated `http`/`https` resource links
- Lightweight metadata validation for message types and identifiers
- PHPUnit, PHPStan, php-cs-fixer, and GitHub Actions included

Requirements
------------

[](#requirements)

- PHP 8.2 or newer
- Composer for dependency management

Installation
------------

[](#installation)

```
composer require memran/marwa-envelop
```

Quick Start
-----------

[](#quick-start)

```
