snicco/payload-middleware

v1.9.0 2023-09-20 12:57 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.