Skip to content

Instantly share code, notes, and snippets.

@pfk84
pfk84 / MethodOverrideMiddleware.php
Created September 17, 2024 15:06
Framework-X HTTP Method Override Middleware
<?php declare(strict_types=1);
/**
* Enhances HTTP method support by enabling method override functionality.
*
* This middleware allows for the use of PUT, PATCH, and DELETE methods
* in environments where they are not natively supported, such as HTML forms
* or PHP's limited handling of request methods beyond GET and POST.
*
* Method override can be achieved through: