Enable SSL in Laravel behind Load Balance or Proxy AWS

You can do this by adding middle ware as follows

$request->setTrustedProxies( [ $request->getClientIp() ] );

if (!$request->secure())
{

return redirect()->secure($request->getRequestUri());
}
return $next($request);

ofcourse , you should enable the middle ware in app/Http/Kernel.php.

Advertisements