laravel/framework — pull request #2068 by phpmycoder (2013-08-10 14:27:06+00:00)
Title: Added elegant redirecting from Router

Relating to Issue #1862:

This feature pull request simplifies the redirection of old URLs with the `Router` class, by adding several shorthand convenience methods (creating shortcuts to `Redirector::to()`, `Redirector::secure()`, `Redirector::route()`, and `Redirector::action()`). It was mentioned in the issue that although using the appropriate sever configuration would be faster (since it would intervene before Laravel would be loaded), it loses the benefit of easily changing route URIs in Laravel by referring to them by name or action. This PR allows the code below to ease the URL changing process should a redirected URL ever need to be modified:

Route::redirect('/old-page/?p=123', '/');
Route::redirectRoute('/pages/contact/form/contact_us.html', 'contact-us-form');
Route::redirectAction('/view_post?id=welcome', 'PostsController@show', 'welcome');

Unit tests also committed to cover major features of this PR.