0

Is it possible to have custom urls without renaming controller methods when using RESTful routing with Route::controller?

With Route::controller('users', 'UsersController'); I want the url to be users/registration instead of users/create without renaming getCreate method in UsersController.

SUB0DH
  • 5,130
  • 4
  • 29
  • 46

1 Answers1

0

Yes you can. Before Route::controller('users', 'UsersController'); in your routes, you can add the following line:

Route::get('users/registration', 'UsersController@getCreate');

By doing that you're explicitly specifying that you want the GET request for users/registration to be handled by getCreate method on the UsersController class.

SUB0DH
  • 5,130
  • 4
  • 29
  • 46