Skip to content

Instantly share code, notes, and snippets.

@clouddueling
Created May 8, 2014 07:50
Show Gist options
  • Save clouddueling/61f62e5de9cf5d2d5b78 to your computer and use it in GitHub Desktop.
Save clouddueling/61f62e5de9cf5d2d5b78 to your computer and use it in GitHub Desktop.
<?php
/**
* Create a redirect response.
*
* <code>
* // Create a redirect response to a location within the application
* return Redirect::to('user/profile');
*
* // Create a redirect response with a 301 status code
* return Redirect::to('user/profile', 301);
* </code>
*
* @param string $url
* @param int $status
* @param bool $https
* @return Redirect
*/
public static function to($url, $status = 302, $https = null)
{
return static::make('', $status)->header('Location', URL::to($url, $https));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment