Method |
Description |
|
all ( string $pattern, object | callable $fn ) |
Shorthand for a route accessed using any method |
|
before ( string $methods, string $pattern, object | callable $fn ) |
Store a before middleware route and a handling function to be executed when accessed using one of the specified methods |
|
delete ( string $pattern, object | callable $fn ) |
Shorthand for a route accessed using DELETE |
|
get ( string $pattern, object | callable $fn ) |
Shorthand for a route accessed using GET |
|
getRequestHeaders ( ) : array |
Get all request headers |
|
getRequestMethod ( ) : string |
Get the request method used, taking overrides into account |
|
match ( string $methods, string $pattern, object | callable $fn ) |
Store a route and a handling function to be executed when accessed using one of the specified methods |
|
mount ( string $baseRoute, callable $fn ) |
Mounts a collection of callbacks onto a base route |
|
options ( string $pattern, object | callable $fn ) |
Shorthand for a route accessed using OPTIONS |
|
patch ( string $pattern, object | callable $fn ) |
Shorthand for a route accessed using PATCH |
|
post ( string $pattern, object | callable $fn ) |
Shorthand for a route accessed using POST |
|
put ( string $pattern, object | callable $fn ) |
Shorthand for a route accessed using PUT |
|
run ( object | callable $callback = null ) : boolean |
Execute the router: Loop all defined before middleware's and routes, and execute the handling function if a match was found |
|
set404 ( object | callable $fn ) |
Set the 404 handling function |
|