1 | <?php |
||
8 | class ResourceRegistrar extends BaseResourceRegistrar |
||
9 | { |
||
10 | /** |
||
11 | * The default actions for a singular resourceful controller. |
||
12 | * |
||
13 | * @var array |
||
14 | */ |
||
15 | protected $singularResourceDefaults = ['create', 'store', 'show', 'edit', 'update', 'destroy']; |
||
16 | |||
17 | /** |
||
18 | * The resources to treat as singular. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected $singularResources = []; |
||
23 | |||
24 | /** |
||
25 | * Route a resource to a controller. |
||
26 | * |
||
27 | * @param string $name |
||
28 | * @param string $controller |
||
29 | * @param array $options |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | 15 | public function register($name, $controller, array $options = []) |
|
72 | |||
73 | /** |
||
74 | * Get the default resource methods defaults for the given resource. |
||
75 | * |
||
76 | * @param string $resource |
||
77 | * |
||
78 | * @return array |
||
79 | */ |
||
80 | 15 | protected function getResourceDefaults($resource) |
|
88 | |||
89 | /** |
||
90 | * Add the show method for a resourceful route. |
||
91 | * |
||
92 | * @param string $name |
||
93 | * @param string $base |
||
94 | * @param string $controller |
||
95 | * @param array $options |
||
96 | * |
||
97 | * @return \Illuminate\Routing\Route |
||
98 | */ |
||
99 | 15 | protected function addResourceShow($name, $base, $controller, $options) |
|
107 | |||
108 | /** |
||
109 | * Add the edit method for a resourceful route. |
||
110 | * |
||
111 | * @param string $name |
||
112 | * @param string $base |
||
113 | * @param string $controller |
||
114 | * @param array $options |
||
115 | * |
||
116 | * @return \Illuminate\Routing\Route |
||
117 | */ |
||
118 | 15 | protected function addResourceEdit($name, $base, $controller, $options) |
|
126 | |||
127 | /** |
||
128 | * Add the update method for a resourceful route. |
||
129 | * |
||
130 | * @param string $name |
||
131 | * @param string $base |
||
132 | * @param string $controller |
||
133 | * @param array $options |
||
134 | * |
||
135 | * @return \Illuminate\Routing\Route |
||
136 | */ |
||
137 | 15 | protected function addResourceUpdate($name, $base, $controller, $options) |
|
145 | |||
146 | /** |
||
147 | * Add the destroy method for a resourceful route. |
||
148 | * |
||
149 | * @param string $name |
||
150 | * @param string $base |
||
151 | * @param string $controller |
||
152 | * @param array $options |
||
153 | * |
||
154 | * @return \Illuminate\Routing\Route |
||
155 | */ |
||
156 | 15 | protected function addResourceDestroy($name, $base, $controller, $options) |
|
164 | |||
165 | /** |
||
166 | * Get the URI for a nested resource segment array. |
||
167 | * |
||
168 | * @param array $segments |
||
169 | * |
||
170 | * @return string |
||
171 | */ |
||
172 | protected function getNestedResourceUri(array $segments) |
||
181 | |||
182 | /** |
||
183 | * Format a resource parameter for usage. |
||
184 | * |
||
185 | * @param string $value |
||
186 | * |
||
187 | * @return string|null |
||
188 | */ |
||
189 | 15 | public function getResourceWildcard($value) |
|
208 | |||
209 | /** |
||
210 | * Get the parameter name as a resource URI parameter segment. |
||
211 | * |
||
212 | * @param string $value |
||
213 | * |
||
214 | * @return string |
||
215 | */ |
||
216 | 15 | protected function getResourceUriParameter($value) |
|
224 | |||
225 | /** |
||
226 | * Get the url verb for the specified verb. |
||
227 | * |
||
228 | * @return string |
||
229 | */ |
||
230 | 15 | protected function getVerb($verb) |
|
239 | } |
||
240 |