RouteRegistrar
class RouteRegistrar
Properties
protected Router | $router | The router instance. |
|
protected array | $attributes | The attributes to pass on to the router. |
|
protected array | $passthru | The methods to dynamically pass through to the router. |
|
protected array | $allowedAttributes | The attributes that can be set through this class. |
|
protected array | $aliases | The attributes that are aliased. |
Methods
void
$this
attribute(string $key, mixed $value)
Set the value for a given attribute.
void
resource(string $name, string $controller, array $options = [])
Route a resource to a controller.
registerRoute(string $method, string $uri, Closure|array|string|null $action = null)
Register a new route with the router.
array
compileAction(Closure|array|string|null $action)
Compile the action into an array including the attributes.
Details
at line 58
void
__construct(Router $router)
Create a new route registrar instance.
at line 72
$this
attribute(string $key, mixed $value)
Set the value for a given attribute.
at line 91
void
resource(string $name, string $controller, array $options = [])
Route a resource to a controller.
at line 102
void
group(Closure|string $callback)
Create a route group with shared attributes.
at line 115
Route
match(array|string $methods, string $uri, Closure|array|string|null $action = null)
Register a new route with the given verbs.
at line 128
protected Route
registerRoute(string $method, string $uri, Closure|array|string|null $action = null)
Register a new route with the router.
at line 143
protected array
compileAction(Closure|array|string|null $action)
Compile the action into an array including the attributes.
at line 163
Route|$this
__call(string $method, array $parameters)
Dynamically handle calls into the route registrar.