From 6ac63a73f08d868d6de8bb5e47443cc8ff8ee118 Mon Sep 17 00:00:00 2001 From: Roman Andreevich Date: Sun, 1 Sep 2024 18:26:10 +0300 Subject: [PATCH] add head request method --- src/Router.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Router.php b/src/Router.php index 231f65b..1a6ca05 100644 --- a/src/Router.php +++ b/src/Router.php @@ -235,6 +235,17 @@ public static function delete(string $pattern, $handler) static::match('DELETE', $pattern, $handler); } + /** + * Add a route with HEAD method + * + * @param string $pattern The route pattern/path to match + * @param string|array|callable The handler for route when matched + */ + public static function head(string $pattern, $handler) + { + static::match('HEAD', $pattern, $handler); + } + /** * Add a route that sends an HTTP redirect *