RouteRegistrar

class RouteRegistrar (View source)

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 __construct(Router $router)

Create a new route registrar instance.

$this attribute(string $key, mixed $value)

Set the value for a given attribute.

PendingResourceRegistration resource(string $name, string $controller, array $options = [])

Route a resource to a controller.

PendingResourceRegistration apiResource(string $name, string $controller, array $options = [])

Route an API resource to a controller.

void group(Closure|string $callback)

Create a route group with shared attributes.

Route match(array|string $methods, string $uri, Closure|array|string|null $action = null)

Register a new route with the given verbs.

Route 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.

Route|$this __call(string $method, array $parameters)

Dynamically handle calls into the route registrar.

Route get(string $uri, Closure|array|string|null $action = null)

No description

Route post(string $uri, Closure|array|string|null $action = null)

No description

Route put(string $uri, Closure|array|string|null $action = null)

No description

Route delete(string $uri, Closure|array|string|null $action = null)

No description

Route patch(string $uri, Closure|array|string|null $action = null)

No description

Route options(string $uri, Closure|array|string|null $action = null)

No description

Route any(string $uri, Closure|array|string|null $action = null)

No description

RouteRegistrar as(string $value)

No description

RouteRegistrar domain(string $value)

No description

RouteRegistrar middleware(array|string|null $middleware)

No description

RouteRegistrar name(string $value)

No description

RouteRegistrar namespace(string $value)

No description

RouteRegistrar prefix(string $ = $prefix)

No description

RouteRegistrar where(array $ = $where)

No description

Details

void __construct(Router $router)

Create a new route registrar instance.

Parameters

Router $router

Return Value

void

$this attribute(string $key, mixed $value)

Set the value for a given attribute.

Parameters

string $key
mixed $value

Return Value

$this

Exceptions

InvalidArgumentException

PendingResourceRegistration resource(string $name, string $controller, array $options = [])

Route a resource to a controller.

Parameters

string $name
string $controller
array $options

Return Value

PendingResourceRegistration

PendingResourceRegistration apiResource(string $name, string $controller, array $options = [])

Route an API resource to a controller.

Parameters

string $name
string $controller
array $options

Return Value

PendingResourceRegistration

void group(Closure|string $callback)

Create a route group with shared attributes.

Parameters

Closure|string $callback

Return Value

void

Route match(array|string $methods, string $uri, Closure|array|string|null $action = null)

Register a new route with the given verbs.

Parameters

array|string $methods
string $uri
Closure|array|string|null $action

Return Value

Route

protected Route registerRoute(string $method, string $uri, Closure|array|string|null $action = null)

Register a new route with the router.

Parameters

string $method
string $uri
Closure|array|string|null $action

Return Value

Route

protected array compileAction(Closure|array|string|null $action)

Compile the action into an array including the attributes.

Parameters

Closure|array|string|null $action

Return Value

array

Route|$this __call(string $method, array $parameters)

Dynamically handle calls into the route registrar.

Parameters

string $method
array $parameters

Return Value

Route|$this

Exceptions

BadMethodCallException

Route get(string $uri, Closure|array|string|null $action = null)

Parameters

string $uri
Closure|array|string|null $action

Return Value

Route

Route post(string $uri, Closure|array|string|null $action = null)

Parameters

string $uri
Closure|array|string|null $action

Return Value

Route

Route put(string $uri, Closure|array|string|null $action = null)

Parameters

string $uri
Closure|array|string|null $action

Return Value

Route

Route delete(string $uri, Closure|array|string|null $action = null)

Parameters

string $uri
Closure|array|string|null $action

Return Value

Route

Route patch(string $uri, Closure|array|string|null $action = null)

Parameters

string $uri
Closure|array|string|null $action

Return Value

Route

Route options(string $uri, Closure|array|string|null $action = null)

Parameters

string $uri
Closure|array|string|null $action

Return Value

Route

Route any(string $uri, Closure|array|string|null $action = null)

Parameters

string $uri
Closure|array|string|null $action

Return Value

Route

RouteRegistrar as(string $value)

Parameters

string $value

Return Value

RouteRegistrar

RouteRegistrar domain(string $value)

Parameters

string $value

Return Value

RouteRegistrar

RouteRegistrar middleware(array|string|null $middleware)

Parameters

array|string|null $middleware

Return Value

RouteRegistrar

RouteRegistrar name(string $value)

Parameters

string $value

Return Value

RouteRegistrar

RouteRegistrar namespace(string $value)

Parameters

string $value

Return Value

RouteRegistrar

RouteRegistrar prefix(string $ = $prefix)

Parameters

string $

Return Value

RouteRegistrar

RouteRegistrar where(array $ = $where)

Parameters

array $

Return Value

RouteRegistrar

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/7.x/Illuminate/Routing/RouteRegistrar.html