PHPackages                             ecrmnn/laravel-https - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. ecrmnn/laravel-https

ActiveModule[Security](/categories/security)

ecrmnn/laravel-https
====================

Force HTTPS in your Laravel application

1.0.7(8y ago)61154.7k↓37.7%9[1 PRs](https://github.com/ecrmnn/laravel-https/pulls)3MITPHPPHP &gt;=7.0

Since Jul 19Pushed 8y ago2 watchersCompare

[ Source](https://github.com/ecrmnn/laravel-https)[ Packagist](https://packagist.org/packages/ecrmnn/laravel-https)[ RSS](/packages/ecrmnn-laravel-https/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (3)Used By (3)

[![laravel-https](https://raw.githubusercontent.com/ecrmnn/laravel-https/master/laravel-https.png)](https://raw.githubusercontent.com/ecrmnn/laravel-https/master/laravel-https.png)
====================================================================================================================================================================================

[](#)

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

[![](https://camo.githubusercontent.com/90c9c887feae745cfa2dba2c4f8d52a76c4580c02e117b40a48d0ccc4c8994bd/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6563726d6e6e2f6c61726176656c2d68747470732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/ecrmnn/laravel-https/builds)[![](https://camo.githubusercontent.com/7ed16e45d7fa0369b2a683dd4923d9c96b85adb86e7c5d68e7365072a5b09b4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6563726d6e6e2f6c61726176656c2d68747470732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ecrmnn/laravel-https)[![](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)[![](https://camo.githubusercontent.com/25b3e6d0d42c98de74a98cbb4d149a1c09020cf6d1361993b72d7d5b8ffed363/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](http://makeapullrequest.com)[![](https://camo.githubusercontent.com/224e94abc714485928f8cdcbc758013eda1363b252c0743caf7dfa7f6257015a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64655f7374796c652d5053525f322d626c75652e7376673f7374796c653d666c61742d737175617265)](http://www.php-fig.org/psr/psr-2/)

### Installation

[](#installation)

##### Add to your project using Composer

[](#add-to-your-project-using-composer)

```
composer require ecrmnn/laravel-https
```

##### Add under `providers` in `config/app.php`

[](#add-under-providers-in-configappphp)

```
\Ecrmnn\LaravelHttps\Providers\ServiceProvider::class,
```

##### Add under `$middleware` in `app/Http/Kernel.php`

[](#add-under-middleware-in-apphttpkernelphp)

```
\Ecrmnn\LaravelHttps\Http\Middleware\ForceHttps::class,
```

### Usage

[](#usage)

##### Set environment variable

[](#set-environment-variable)

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

```
HTTPS=true
```

### What is this?

[](#what-is-this)

##### Generate HTTPS-links automagically

[](#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

[](#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

[](#requirements)

- Laravel 5.0 +
- PHP 7 +

### License

[](#license)

MIT © [Daniel Eckermann](http://danieleckermann.com)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Total

2

Last Release

3241d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1481696?v=4)[Daniel Eckermann](/maintainers/ecrmnn)[@ecrmnn](https://github.com/ecrmnn)

---

Top Contributors

[![ecrmnn](https://avatars.githubusercontent.com/u/1481696?v=4)](https://github.com/ecrmnn "ecrmnn (9 commits)")[![guiwoda](https://avatars.githubusercontent.com/u/1625545?v=4)](https://github.com/guiwoda "guiwoda (1 commits)")

---

Tags

httpslaravellaravel-packagemiddlewarephp7secure

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ecrmnn-laravel-https/health.svg)

```
[![Health](https://phpackages.com/badges/ecrmnn-laravel-https/health.svg)](https://phpackages.com/packages/ecrmnn-laravel-https)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.7M143](/packages/mews-purifier)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24820.0k37](/packages/paragonie-ecc)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
