snicco/payload-middleware

v2.0.0-beta.9 2024-09-07 14:27 UTC

README

codecov Psalm Type-Coverage Psalm level PhpMetrics - Static Analysis PHP-Versions

This package provides middleware for snicco/http-routing to transform the request body to a plain array.

Currently, a JsonToArray middleware is provided. You can build your own middleware by extending the abstract Payload middleware.

Installation

composer require snicco/payload-middleware

Usage

This middleware can either be added globally, in certain groups or on a per-route basis. Choose what works best for you.

use Snicco\Middleware\Payload\JsonToArray;

$configurator->get('route1', '/route1', SomeController::class)
             ->middleware(JsonToArray::class);

Contributing

This repository is a read-only split of the development repo of the Snicco project.

This is how you can contribute.

Reporting issues and sending pull requests

Please report issues in the Snicco monorepo.

Security

If you discover a security vulnerability, please follow our disclosure procedure.