RouteGroup
class RouteGroup
Methods
Constructor for the RouteGroup class.
Get the parent route group.
Get the full prefix for the route group, including parent prefixes.
Get the prefix for the route group.
Get the list of routes in the group.
Add a route to the group.
Add a middleware to the group.
Get the list of middlewares applied to the group.
Parse the routes in the group, applying parent middlewares and namespaces.
Set the namespace for the group.
Details
at line 36
__construct(string $prefix = '', RouteGroup|null $parent = null)
Constructor for the RouteGroup class.
at line 46
RouteGroup|null
getParent()
Get the parent route group.
at line 55
string
fullPrefix()
Get the full prefix for the route group, including parent prefixes.
at line 72
string
getPrefix()
Get the prefix for the route group.
at line 81
array
getRoutes()
Get the list of routes in the group.
at line 93
Route
addRoute(string|array $methods, string $path, callable|string $handler)
Add a route to the group.
at line 118
Route
get(string $path, callable|string $handler)
Add a GET route to the group.
at line 129
Route
post(string $path, callable|string $handler)
Add a POST route to the group.
at line 140
Route
patch(string $path, callable|string $handler)
Add a PATCH route to the group.
at line 151
Route
put(string $path, callable|string $handler)
Add a PUT route to the group.
at line 162
Route
head(string $path, callable|string $handler)
Add a HEAD route to the group.
at line 173
Route
delete(string $path, callable|string $handler)
Add a DELETE route to the group.
at line 185
Route
view(string $url, string $name, array $arguments = [])
Add a GET route that returns a view.
at line 197
$this
middleware(string $middleware)
Add a middleware to the group.
at line 207
array
getMiddlewares()
Get the list of middlewares applied to the group.
at line 216
parseRoutes(null|array $routes = null)
Parse the routes in the group, applying parent middlewares and namespaces.
at line 241
$this
namespace(string $namespace)
Set the namespace for the group.