class Illuminate / Routing / RouteRegistrar

RouteRegistrar

Uses

Properties

protected

$router Router

The router instance.

Default: null
protected

$attributes array

The attributes to pass on to the router.

Default: []
protected

$passthru string[]

The methods to dynamically pass through to the router.

Default: array
protected

$allowedAttributes string[]

The attributes that can be set through this class.

Default: array
protected

$aliases array

The attributes that are aliased.

Default: array

Methods

public

__construct ( Router $router ) : void

Create a new route registrar instance.

Parameters

public

attribute ( $key , $value ) : $this

Set the value for a given attribute.

Parameters

  • $key string
  • $value mixed
public

resource ( $name , $controller , array $options ) : PendingResourceRegistration

Route a resource to a controller.

Parameters

  • $name string
  • $controller string
  • $options array
public

apiResource ( $name , $controller , array $options ) : PendingResourceRegistration

Route an API resource to a controller.

Parameters

  • $name string
  • $controller string
  • $options array
public

singleton ( $name , $controller , array $options ) : PendingSingletonResourceRegistration

Route a singleton resource to a controller.

Parameters

  • $name string
  • $controller string
  • $options array
public

apiSingleton ( $name , $controller , array $options ) : PendingSingletonResourceRegistration

Route an API singleton resource to a controller.

Parameters

  • $name string
  • $controller string
  • $options array
public

group ( $callback ) : $this

Create a route group with shared attributes.

Parameters

public

match ( $methods , $uri , $action ) : Route

Register a new route with the given verbs.

Parameters

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

registerRoute ( $method , $uri , $action ) : Route

Register a new route with the router.

Parameters

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

compileAction ( $action ) : array

Compile the action into an array including the attributes.

Parameters

public

__call ( $method , $parameters ) : Route |$this

Dynamically handle calls into the route registrar.

Parameters

  • $method string
  • $parameters array