Skip to content

Commit bda731b

Browse files
committed
wording
1 parent 91cc7ed commit bda731b

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

controllers.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -209,17 +209,27 @@ By default, `Route::resource` will create the route parameters for your resource
209209
<a name="restful-localizing-resource-uris"></a>
210210
### Localizing Resource URIs
211211

212-
By default, `Route::resource` will create the resource URIs for your resource routes using english verbs. If you need to localize the `create` and `edit` action verbs (or even change them to something else) you can easily override this globally using `Route::resourceVerbs()` to set the verbs used in the resource URIs generation:
212+
By default, `Route::resource` will create resource URIs using English verbs. If you need to localize the `create` and `edit` action verbs, you may use the `Route::resourceVerbs` method. This may be done in the `boot` method of your `AppServiceProvider`:
213213

214-
Route::resourceVerbs([
215-
'create' => 'crear',
216-
'edit' => 'editar',
217-
]);
218-
Route::resource('fotos', 'PhotoController');
214+
use Illuminate\Support\Facades\Route;
219215

220-
The example above generates the following URIs for the resource's `create` and `edit` routes:
216+
/**
217+
* Bootstrap any application services.
218+
*
219+
* @return void
220+
*/
221+
public function boot()
222+
{
223+
Route::resourceVerbs([
224+
'create' => 'crear',
225+
'edit' => 'editar',
226+
]);
227+
}
228+
229+
Once the verbs have been customized, a resource route registration such as `Route::resource('fotos', 'PhotoController')` will produce the following URIs:
221230

222231
/fotos/crear
232+
223233
/fotos/{foto}/editar
224234

225235
<a name="restful-supplementing-resource-controllers"></a>

0 commit comments

Comments
 (0)