class Illuminate / Routing / ResourceRegistrar
You are viewing an older version of the documentation. For the latest, please visit master documentation.

ResourceRegistrar

Properties

protected

$router Router

The router instance.

Default: null
protected

$resourceDefaults string[]

The default actions for a resourceful controller.

Default: array
protected

$parameters array|string

The parameters set for this resource instance.

Default: null
protected static

$parameterMap array

The global parameter mapping.

Default: []
protected static

$singularParameters bool

Singular global parameters.

Default: true
protected static

$verbs array

The verbs used in the resource URIs.

Default: array

Methods

public

__construct ( Router $router ) : void

Create a new resource registrar instance.

Parameters

public

register ( $name , $controller , array $options ) : RouteCollection

Route a resource to a controller.

Parameters

  • $name string
  • $controller string
  • $options array
protected

prefixedResource ( $name , $controller , array $options ) : void

Build a set of prefixed resource routes.

Parameters

  • $name string
  • $controller string
  • $options array
protected

getResourcePrefix ( $name ) : array

Extract the resource and prefix from a resource name.

Parameters

  • $name string
protected

getResourceMethods ( $defaults , $options ) : array

Get the applicable resource methods.

Parameters

  • $defaults array
  • $options array
protected

addResourceIndex ( $name , $base , $controller , $options ) : Route

Add the index method for a resourceful route.

Parameters

  • $name string
  • $base string
  • $controller string
  • $options array
protected

addResourceCreate ( $name , $base , $controller , $options ) : Route

Add the create method for a resourceful route.

Parameters

  • $name string
  • $base string
  • $controller string
  • $options array
protected

addResourceStore ( $name , $base , $controller , $options ) : Route

Add the store method for a resourceful route.

Parameters

  • $name string
  • $base string
  • $controller string
  • $options array
protected

addResourceShow ( $name , $base , $controller , $options ) : Route

Add the show method for a resourceful route.

Parameters

  • $name string
  • $base string
  • $controller string
  • $options array
protected

addResourceEdit ( $name , $base , $controller , $options ) : Route

Add the edit method for a resourceful route.

Parameters

  • $name string
  • $base string
  • $controller string
  • $options array
protected

addResourceUpdate ( $name , $base , $controller , $options ) : Route

Add the update method for a resourceful route.

Parameters

  • $name string
  • $base string
  • $controller string
  • $options array
protected

addResourceDestroy ( $name , $base , $controller , $options ) : Route

Add the destroy method for a resourceful route.

Parameters

  • $name string
  • $base string
  • $controller string
  • $options array
protected

getShallowName ( $name , $options ) : string

Get the name for a given resource with shallowness applied when applicable.

Parameters

  • $name string
  • $options array
protected

setResourceBindingFields ( $route , $bindingFields ) : void

Set the route's binding fields if the resource is scoped.

Parameters

  • $route Route
  • $bindingFields array
public

getResourceUri ( $resource ) : string

Get the base resource URI for a given resource.

Parameters

  • $resource string
protected

getNestedResourceUri ( array $segments ) : string

Get the URI for a nested resource segment array.

Parameters

  • $segments array
public

getResourceWildcard ( $value ) : string

Format a resource parameter for usage.

Parameters

  • $value string
protected

getResourceAction ( $resource , $controller , $method , $options ) : array

Get the action array for a resource route.

Parameters

  • $resource string
  • $controller string
  • $method string
  • $options array
protected

getResourceRouteName ( $resource , $method , $options ) : string

Get the name for a given resource.

Parameters

  • $resource string
  • $method string
  • $options array
public static

singularParameters ( $singular ) : void

Set or unset the unmapped global parameters to singular.

Parameters

  • $singular bool
public static

getParameters ( ) : array

Get the global parameter map.

public static

setParameters ( array $parameters ) : void

Set the global parameter mapping.

Parameters

  • $parameters array
public static

verbs ( array $verbs ) : array

Get or set the action verbs used in the resource URIs.

Parameters

  • $verbs array