Route
class Route
Methods
Constructor for the Route class.
Get the HTTP methods supported by the route.
Get the handler for the route.
Add a middleware to the route.
Get the list of middlewares applied to the route.
Get the namespace of the route.
Get the name of the route.
Get the route group the route belongs to.
Set the path of the route.
Get the path of the route.
Set the parameters for the route.
Get the parameters for the route.
Generate the URL for the route.
Details
at line 57
__construct(array $methods, string $path, callable|string $handler)
Constructor for the Route class.
at line 68
array
getMethods()
Get the HTTP methods supported by the route.
at line 77
callable|string
getHandler()
Get the handler for the route.
at line 87
Route
name(string $name)
Set the name of the route.
at line 98
Route
middleware(string $middleware)
Add a middleware to the route.
at line 109
void
mergeGroupMiddlewares(RouteGroup $group)
Merge the middlewares from a route group.
at line 118
array
getMiddlewares()
Get the list of middlewares applied to the route.
at line 128
Route
namespace(string|null $namespace)
Set the namespace for the route.
at line 138
string|null
getNamespace()
Get the namespace of the route.
at line 147
string|null
getName()
Get the name of the route.
at line 156
setGroup(RouteGroup $group)
Set the route group the route belongs to.
at line 165
RouteGroup|null
getGroup()
Get the route group the route belongs to.
at line 174
setPath(string $path)
Set the path of the route.
at line 183
string
getPath()
Get the path of the route.
at line 192
setParams(array $params)
Set the parameters for the route.
at line 201
array
getParams()
Get the parameters for the route.
at line 211
string
toUrl()
Generate the URL for the route.