class Illuminate / Routing / ResourceRegistrar

ResourceRegistrar

Properties

protected

$router Router

The router instance.

Default: null
protected

$resourceDefaults string[]

The default actions for a resourceful controller.

Default: array
protected

$singletonResourceDefaults string[]

The default actions for a singleton resource 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
public

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

Route a singleton resource to a controller.

Parameters

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

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

Build a set of prefixed resource routes.

Parameters

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

prefixedSingleton ( $name , $controller , array $options ) : Router

Build a set of prefixed singleton 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

addSingletonCreate ( $name , $controller , $options ) : Route

Add the create method for a singleton route.

Parameters

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

addSingletonStore ( $name , $controller , $options ) : Route

Add the store method for a singleton route.

Parameters

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

addSingletonShow ( $name , $controller , $options ) : Route

Add the show method for a singleton route.

Parameters

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

addSingletonEdit ( $name , $controller , $options ) : Route

Add the edit method for a singleton route.

Parameters

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

addSingletonUpdate ( $name , $controller , $options ) : Route

Add the update method for a singleton route.

Parameters

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

addSingletonDestroy ( $name , $controller , $options ) : Route

Add the destroy method for a singleton route.

Parameters

  • $name 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