Skip to content

Instantly share code, notes, and snippets.

@thatal
Created May 18, 2021 09:46
Show Gist options
  • Save thatal/c2bed0d98cbc8feafcab5c5f7479a6b5 to your computer and use it in GitHub Desktop.
Save thatal/c2bed0d98cbc8feafcab5c5f7479a6b5 to your computer and use it in GitHub Desktop.
Expose redirected to local site error fixing
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
if(\App::environment()=='local' && isset($_SERVER['HTTP_X_ORIGINAL_HOST'])){
$this->app['url']->forceRootUrl($_SERVER['REQUEST_SCHEME']."://".$_SERVER['HTTP_X_ORIGINAL_HOST']);
}
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment