ResourceRegistrar
class ResourceRegistrar (View source)
Properties
protected Router | $router | The router instance. | |
protected array | $resourceDefaults | The default actions for a resourceful controller. |
Methods
void | __construct(Router $router) Create a new resource registrar instance. | |
void | register(string $name, string $controller, array $options = []) Route a resource to a controller. | |
void | prefixedResource(string $name, string $controller, array $options) Build a set of prefixed resource routes. | |
array | getResourcePrefix(string $name) Extract the resource and prefix from a resource name. | |
array | getResourceMethods(array $defaults, array $options) Get the applicable resource methods. | |
string | getResourceUri(string $resource) Get the base resource URI for a given resource. | |
string | getNestedResourceUri(array $segments) Get the URI for a nested resource segment array. | |
array | getResourceAction(string $resource, string $controller, string $method, array $options) Get the action array for a resource route. | |
string | getResourceName(string $resource, string $method, array $options) Get the name for a given resource. | |
string | getGroupResourceName(string $prefix, string $resource, string $method) Get the resource name for a grouped resource. | |
string | getResourceWildcard(string $value) Format a resource wildcard for usage. | |
Route | addResourceIndex(string $name, string $base, string $controller, array $options) Add the index method for a resourceful route. | |
Route | addResourceCreate(string $name, string $base, string $controller, array $options) Add the create method for a resourceful route. | |
Route | addResourceStore(string $name, string $base, string $controller, array $options) Add the store method for a resourceful route. | |
Route | addResourceShow(string $name, string $base, string $controller, array $options) Add the show method for a resourceful route. | |
Route | addResourceEdit(string $name, string $base, string $controller, array $options) Add the edit method for a resourceful route. | |
void | addResourceUpdate(string $name, string $base, string $controller, array $options) Add the update method for a resourceful route. | |
Route | addPutResourceUpdate(string $name, string $base, string $controller, array $options) Add the update method for a resourceful route. | |
void | addPatchResourceUpdate(string $name, string $base, string $controller) Add the update method for a resourceful route. | |
Route | addResourceDestroy(string $name, string $base, string $controller, array $options) Add the destroy method for a resourceful route. |
Details
void __construct(Router $router)
Create a new resource registrar instance.
void register(string $name, string $controller, array $options = [])
Route a resource to a controller.
protected void prefixedResource(string $name, string $controller, array $options)
Build a set of prefixed resource routes.
protected array getResourcePrefix(string $name)
Extract the resource and prefix from a resource name.
protected array getResourceMethods(array $defaults, array $options)
Get the applicable resource methods.
string getResourceUri(string $resource)
Get the base resource URI for a given resource.
protected string getNestedResourceUri(array $segments)
Get the URI for a nested resource segment array.
protected array getResourceAction(string $resource, string $controller, string $method, array $options)
Get the action array for a resource route.
protected string getResourceName(string $resource, string $method, array $options)
Get the name for a given resource.
protected string getGroupResourceName(string $prefix, string $resource, string $method)
Get the resource name for a grouped resource.
string getResourceWildcard(string $value)
Format a resource wildcard for usage.
protected Route addResourceIndex(string $name, string $base, string $controller, array $options)
Add the index method for a resourceful route.
protected Route addResourceCreate(string $name, string $base, string $controller, array $options)
Add the create method for a resourceful route.
protected Route addResourceStore(string $name, string $base, string $controller, array $options)
Add the store method for a resourceful route.
protected Route addResourceShow(string $name, string $base, string $controller, array $options)
Add the show method for a resourceful route.
protected Route addResourceEdit(string $name, string $base, string $controller, array $options)
Add the edit method for a resourceful route.
protected void addResourceUpdate(string $name, string $base, string $controller, array $options)
Add the update method for a resourceful route.
protected Route addPutResourceUpdate(string $name, string $base, string $controller, array $options)
Add the update method for a resourceful route.
protected void addPatchResourceUpdate(string $name, string $base, string $controller)
Add the update method for a resourceful route.
protected Route addResourceDestroy(string $name, string $base, string $controller, array $options)
Add the destroy method for a resourceful route.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.1/Illuminate/Routing/ResourceRegistrar.html