ecrmnn/laravel-https

Force HTTPS in your Laravel application

Maintainers

👁 ecrmnn

Package info

github.com/ecrmnn/laravel-https

Type:module

pkg:composer/ecrmnn/laravel-https

Statistics

Installs: 154 641

Dependents: 3

Suggesters: 0

Stars: 60

Open Issues: 1

1.0.7 2017-08-17 19:07 UTC

Requires

  • php: >=7.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 63f3de05be67a2045c4eef20a58ab48e97e94976

  • Daniel Eckermann <danieleckermann.woop@gmail.com>

This package is not auto-updated.

Last update: 2026-06-21 11:12:09 UTC


README

Generate HTTPS-links and redirect all requests to HTTPS. Also works with load balancing, AWS, Heroku and other services

👁 Image
👁 Image
👁 Image
👁 Image
👁 Image

Installation

Add to your project using Composer
composer require ecrmnn/laravel-https
Add under providers in config/app.php
\Ecrmnn\LaravelHttps\Providers\ServiceProvider::class,
Add under $middleware in app/Http/Kernel.php
\Ecrmnn\LaravelHttps\Http\Middleware\ForceHttps::class,

Usage

Set environment variable

HTTPS will only be forced when env('HTTPS') is set to true

HTTPS=true

What is this?

Generate HTTPS-links automagically

LaravelHTTPS forces the URL scheme in Laravel to use the HTTPS prefix for all links generated using url() and route(). That mean that all your links can be converted to use HTTPS just by installing LaravelHTTPS

Force redirect HTTP to HTTPS

With the middleware included; ForceHttps, you can simply specify that as a global middleware and all requests will be redirected correctly when accessing a non-HTTPS URL.

Requirements

  • Laravel 5.0 +
  • PHP 7 +

License

MIT © Daniel Eckermann