Skip to main content

Laravel Force Https

use Illuminate\Routing\UrlGenerator;

public function boot(UrlGenerator $url)
{
    public function register()
    {
      // force https
      if (config('app.env') !== 'local' && !filter_var(request()->getHost(), FILTER_VALIDATE_IP)) {
          $this->app['request']->server->set('HTTPS', true);
    }
}