jeudi 28 février 2019

How to modify http_host in laravel 5

How to modify the return of request()->getHttpHost() in Laravel 5.

I used a middelware to modify $_SERVER[HTTP_HOST], but it was not affected.

class ModifyHttpHost
{
    public function handle($request, Closure $next)
    {
        $_SERVER['HTTP_HOST'] = 'another.com';
        return $next($request);
    }
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire