Documentation

RouteRegistrar
in package

Table of Contents

$aliases  : array<string|int, mixed>
The attributes that are aliased.
$allowedAttributes  : array<string|int, mixed>
The attributes that can be set through this class.
$attributes  : array<string|int, mixed>
The attributes to pass on to the router.
$passthru  : array<string|int, mixed>
The methods to dynamically pass through to the router.
$router  : Router
The router instance.
__call()  : Route|$this
Dynamically handle calls into the route registrar.
__construct()  : void
Create a new route registrar instance.
attribute()  : $this
Set the value for a given attribute.
group()  : void
Create a route group with shared attributes.
match()  : Route
Register a new route with the given verbs.
resource()  : PendingResourceRegistration
Route a resource to a controller.
compileAction()  : array<string|int, mixed>
Compile the action into an array including the attributes.
registerRoute()  : Route
Register a new route with the router.

Properties

$aliases

The attributes that are aliased.

protected array<string|int, mixed> $aliases = ['name' => 'as']

$allowedAttributes

The attributes that can be set through this class.

protected array<string|int, mixed> $allowedAttributes = ['as', 'domain', 'middleware', 'name', 'namespace', 'prefix']

$attributes

The attributes to pass on to the router.

protected array<string|int, mixed> $attributes = []

$passthru

The methods to dynamically pass through to the router.

protected array<string|int, mixed> $passthru = ['get', 'post', 'put', 'patch', 'delete', 'options', 'any']

Methods

__call()

Dynamically handle calls into the route registrar.

public __call(string $method, array<string|int, mixed> $parameters) : Route|$this
Parameters
$method : string
$parameters : array<string|int, mixed>
Return values
Route|$this

__construct()

Create a new route registrar instance.

public __construct(Router $router) : void
Parameters
$router : Router
Return values
void

attribute()

Set the value for a given attribute.

public attribute(string $key, mixed $value) : $this
Parameters
$key : string
$value : mixed
Tags
throws
InvalidArgumentException
Return values
$this

group()

Create a route group with shared attributes.

public group(Closure|string $callback) : void
Parameters
$callback : Closure|string
Return values
void

match()

Register a new route with the given verbs.

public match(array<string|int, mixed>|string $methods, string $uri[, Closure|array<string|int, mixed>|string|null $action = null ]) : Route
Parameters
$methods : array<string|int, mixed>|string
$uri : string
$action : Closure|array<string|int, mixed>|string|null = null
Return values
Route

compileAction()

Compile the action into an array including the attributes.

protected compileAction(Closure|array<string|int, mixed>|string|null $action) : array<string|int, mixed>
Parameters
$action : Closure|array<string|int, mixed>|string|null
Return values
array<string|int, mixed>

registerRoute()

Register a new route with the router.

protected registerRoute(string $method, string $uri[, Closure|array<string|int, mixed>|string|null $action = null ]) : Route
Parameters
$method : string
$uri : string
$action : Closure|array<string|int, mixed>|string|null = null
Return values
Route

Search results