Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Added head method to router to allow implicit call via HEAD HTTP method #30646

Merged
merged 2 commits into from
Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/Illuminate/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ public function __construct(Dispatcher $events, Container $container = null)
$this->container = $container ?: new Container;
}

/**
* Register a new HEAD route with the router.
*
* @param string $uri
* @param \Closure|array|string|callable|null $action
* @return \Illuminate\Routing\Route
*/
public function head($uri, $action = null)
{
return $this->addRoute('HEAD', $uri, $action);
}

/**
* Register a new GET route with the router.
*
Expand Down
1 change: 1 addition & 0 deletions src/Illuminate/Support/Facades/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

/**
* @method static \Illuminate\Routing\Route get(string $uri, \Closure|array|string|callable|null $action = null)
* @method static \Illuminate\Routing\Route head(string $uri, \Closure|array|string|callable|null $action = null)
* @method static \Illuminate\Routing\Route post(string $uri, \Closure|array|string|callable|null $action = null)
* @method static \Illuminate\Routing\Route put(string $uri, \Closure|array|string|callable|null $action = null)
* @method static \Illuminate\Routing\Route delete(string $uri, \Closure|array|string|callable|null $action = null)
Expand Down