ResourceRegistrar
Properties
$resourceDefaults string[]
The default actions for a resourceful controller.
$parameters array|string
The parameters set for this resource instance.
$parameterMap array
The global parameter mapping.
$singularParameters bool
Singular global parameters.
$verbs array
The verbs used in the resource URIs.
Methods
__construct ( Router $router ) : void
Create a new resource registrar instance.
Parameters
- $router Router
register ( $name , $controller , array $options ) : RouteCollection
Route a resource to a controller.
Parameters
- $name string
- $controller string
- $options array
prefixedResource ( $name , $controller , array $options ) : void
Build a set of prefixed resource routes.
Parameters
- $name string
- $controller string
- $options array
getResourcePrefix ( $name ) : array
Extract the resource and prefix from a resource name.
Parameters
- $name string
getResourceMethods ( $defaults , $options ) : array
Get the applicable resource methods.
Parameters
- $defaults array
- $options array
addResourceIndex ( $name , $base , $controller , $options ) : Route
Add the index method for a resourceful route.
Parameters
- $name string
- $base string
- $controller string
- $options array
addResourceCreate ( $name , $base , $controller , $options ) : Route
Add the create method for a resourceful route.
Parameters
- $name string
- $base string
- $controller string
- $options array
addResourceStore ( $name , $base , $controller , $options ) : Route
Add the store method for a resourceful route.
Parameters
- $name string
- $base string
- $controller string
- $options array
addResourceShow ( $name , $base , $controller , $options ) : Route
Add the show method for a resourceful route.
Parameters
- $name string
- $base string
- $controller string
- $options array
addResourceEdit ( $name , $base , $controller , $options ) : Route
Add the edit method for a resourceful route.
Parameters
- $name string
- $base string
- $controller string
- $options array
addResourceUpdate ( $name , $base , $controller , $options ) : Route
Add the update method for a resourceful route.
Parameters
- $name string
- $base string
- $controller string
- $options array
addResourceDestroy ( $name , $base , $controller , $options ) : Route
Add the destroy method for a resourceful route.
Parameters
- $name string
- $base string
- $controller string
- $options array
getShallowName ( $name , $options ) : string
Get the name for a given resource with shallowness applied when applicable.
Parameters
- $name string
- $options array
setResourceBindingFields ( $route , $bindingFields ) : void
Set the route's binding fields if the resource is scoped.
Parameters
- $route Route
- $bindingFields array
getResourceUri ( $resource ) : string
Get the base resource URI for a given resource.
Parameters
- $resource string
getNestedResourceUri ( array $segments ) : string
Get the URI for a nested resource segment array.
Parameters
- $segments array
getResourceWildcard ( $value ) : string
Format a resource parameter for usage.
Parameters
- $value string
getResourceAction ( $resource , $controller , $method , $options ) : array
Get the action array for a resource route.
Parameters
- $resource string
- $controller string
- $method string
- $options array
getResourceRouteName ( $resource , $method , $options ) : string
Get the name for a given resource.
Parameters
- $resource string
- $method string
- $options array
singularParameters ( $singular ) : void
Set or unset the unmapped global parameters to singular.
Parameters
- $singular bool
getParameters ( ) : array
Get the global parameter map.
setParameters ( array $parameters ) : void
Set the global parameter mapping.
Parameters
- $parameters array
verbs ( array $verbs ) : array
Get or set the action verbs used in the resource URIs.
Parameters
- $verbs array