Skip to content
Advertisement

Laravel custom action names and route names using a resource controller?

By default Resource controller gives you those Actions and Route names:

JavaScript

and want to rename both of them (Actions and Routes names) to:

JavaScript

And still use a Resource Controllers, like this:

JavaScript

and not a list of GET routes like this:

JavaScript

Advertisement

Answer

Here is a good solution suggested by Laravel doc:

JavaScript

The rest will have the default names.

Related section in Laravel docs: https://laravel.com/docs/5.2/controllers#restful-naming-resource-routes

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement