framework icon indicating copy to clipboard operation
framework copied to clipboard

[Request] Simplify Naming of RESTful Controller Routes

Open animecyc opened this issue 13 years ago • 6 comments

As it stands to create a named route for, say, FooController@getSomeMethod we would need to do the following:

Route::controller('/foo', 'FooController');
Route::get('/foo/some-method', array('as' => 'fooPage', 'uses' => 'FooController@getSomeMethod'));

This can start to get unwieldily for applications with the need for many named routes across multiple controllers. It think it would be a bit more DRY if we could do something like:

Route::controller('/foo', 'FooController')->named(array('fooPage' => 'getSomeMethod'));

Or any derivative therein. Anyone have any input on this?

animecyc avatar Apr 15 '13 21:04 animecyc

:+1:

iicmaster avatar Apr 16 '13 01:04 iicmaster

Name controller routing would be awesome.

WMeldon avatar Apr 16 '13 12:04 WMeldon

would this be suitable? https://github.com/illuminate/routing/pull/33

ghost avatar Apr 18 '13 14:04 ghost

:+1:

stefanneubig avatar Apr 18 '13 15:04 stefanneubig

:+1:

codegefluester avatar Apr 18 '13 15:04 codegefluester

made a new pull-request for this repo. https://github.com/laravel/framework/pull/998

ghost avatar Apr 18 '13 15:04 ghost