Download the PHP package satheez/laravel-message-contracts without Composer

On this page you can find all versions of the php package satheez/laravel-message-contracts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-message-contracts

Laravel Message Contracts

A Laravel package for defining, validating, versioning, documenting, and testing the JSON payloads your services exchange.

[![CI](https://github.com/satheez/laravel-message-contracts/actions/workflows/ci.yml/badge.svg)](https://github.com/satheez/laravel-message-contracts/actions) [![Latest Version on Packagist](https://img.shields.io/packagist/v/satheez/laravel-message-contracts.svg)](https://packagist.org/packages/satheez/laravel-message-contracts) [![Total Downloads](https://img.shields.io/packagist/dt/satheez/laravel-message-contracts.svg)](https://packagist.org/packages/satheez/laravel-message-contracts) [![PHP](https://img.shields.io/badge/PHP-8.2%2B-blue)](https://www.php.net) [![Laravel](https://img.shields.io/badge/Laravel-12%20%7C%2013-red)](https://laravel.com) [![License](https://img.shields.io/packagist/l/satheez/laravel-message-contracts.svg)](LICENSE.md)

Laravel Message Contracts turns queue, event, webhook, and broker payloads into explicit PHP classes. A contract class gives each message a stable name, an integer version, Laravel validation rules, examples, generated JSON Schema, AsyncAPI documentation, compatibility snapshots, and test assertions.

The package is transport-agnostic. It does not replace RabbitMQ, SQS, Kafka, Redis, Laravel queues, webhooks, an outbox, retries, or delivery guarantees. It protects the JSON message body that moves through those systems.

Use it when multiple producers, consumers, services, or teams need a shared payload boundary that is stricter than plain arrays but lighter than a full schema registry.

Highlights

Requirements

Requirement Version
PHP ^8.2 (Laravel 13 requires PHP 8.3+)
Laravel ^12.0 or ^13.0

Installation

Optionally publish the generator stub:

See Installation for the full setup flow.

Quick Start

Imagine you publish a user.registered event that an email service, analytics pipeline, and billing service all consume. A message contract makes the payload shape explicit, validated, and versioned so every consumer knows exactly what to expect.

Generate a contract class:

Define the payload rules in the generated class:

Register it in config/message-contracts.php:

Create and serialize a producer message:

Parse and validate a consumer message:

The default envelope contains contract, version, payload, and optional meta keys. Metadata such as message_id and created_at can be configured.

Important Concepts

Concept Summary
Contract name Stable dot-notation name such as user.registered. Do not include the version.
Version Integer starting at 1. Add a new version for breaking payload changes.
Strict mode Rejects payload keys that are not declared in rules(). Enabled by default.
Registry Resolves incoming messages by contract and version.
Snapshot Captures current schemas so CI can detect breaking changes later.

For breaking changes, create UserRegisteredV2Message and keep V1 registered until consumers migrate.

Command Overview

Command Purpose
make:message-contract Scaffold a versioned contract class.
message-contracts:list Show registered contracts.
message-contracts:validate Validate a raw payload or full envelope.
message-contracts:validate-examples Validate every contract example().
message-contracts:export-json-schema Export payload or envelope JSON Schemas.
message-contracts:export-asyncapi Export AsyncAPI documentation.
message-contracts:snapshot Save the current contract schema snapshot.
message-contracts:check-breaking-changes Compare current contracts to a previous snapshot.

See Output formats, and CI for command options and CI examples.

Documentation

Guide Covers
Installation Composer install, publishing config and stubs, first contract setup
Usage guide Defining, registering, producing, consuming, and validating messages
Configuration config/message-contracts.php options, strict mode, metadata, schema export
Architecture Core classes, producer flow, consumer flow, and generated docs
Output formats Message envelopes, list JSON, JSON Schema, AsyncAPI, and snapshots
Checks Artisan validation, schema, example, and compatibility checks
CI GitHub Actions patterns for package and application contract checks
Comparison How this package compares with plain arrays, Form Requests, JSON Schema, AsyncAPI, and schema registries
Examples and recipes Versioning, testing helpers, example validation, Laravel Jobs, and producer-side patterns
FAQ Common usage, versioning, strict mode, envelope, schema, and Spatie Data questions

Contributing

See CONTRIBUTING.md for local setup, coding standards, and pull request guidelines.

Changelog

All notable changes are documented in CHANGELOG.md.

License

Laravel Message Contracts is open-sourced software licensed under the MIT license.


All versions of laravel-message-contracts with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
laravel/framework Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package satheez/laravel-message-contracts contains the following files

Loading the files please wait ...