Created
May 5, 2016 18:34
-
-
Save taylorotwell/26c226f5a5c35b698340949d0e1b1b78 to your computer and use it in GitHub Desktop.
Rewriting Links
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class RewriteLinks | |
{ | |
/** | |
* Handle an incoming request. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @param \Closure $next | |
* @return mixed | |
*/ | |
public function handle($request, Closure $next) | |
{ | |
if (app()->environment('local') && $request->hasHeader('x-original-host')) { | |
url()->forceRootUrl('http://'.$request->header('x-original-host')); | |
} | |
return $next($request); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@taylorotwell What was this for, out of interest?