PHPackages                             jkniest/force-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. jkniest/force-https

AbandonedArchivedLibrary[Security](/categories/security)

jkniest/force-https
===================

Laravel Middleware to force a secure connection

1.0.2(8y ago)11.1kMITPHP

Since Jan 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/jkniest/ForceHttps)[ Packagist](https://packagist.org/packages/jkniest/force-https)[ RSS](/packages/jkniest-force-https/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Force HTTPS Middleware
======================

[](#force-https-middleware)

[![Latest Stable Version](https://camo.githubusercontent.com/cc069432fbb190eb376339d4dc8350242c323a329c1add0c9104e23c7e47d427/68747470733a2f2f706f7365722e707567782e6f72672f6a6b6e696573742f666f7263652d68747470732f762f737461626c65)](https://packagist.org/packages/jkniest/force-https) [![Total Downloads](https://camo.githubusercontent.com/03fc68276d51062a55f1f08f3b7422a025cbb990fb0a1518253f007650747865/68747470733a2f2f706f7365722e707567782e6f72672f6a6b6e696573742f666f7263652d68747470732f646f776e6c6f616473)](https://packagist.org/packages/jkniest/force-https) [![License](https://camo.githubusercontent.com/6e12486c4111eb918eb0840bfe2aebde0d4b0f499793ebd0b061ce167c5681e2/68747470733a2f2f706f7365722e707567782e6f72672f6a6b6e696573742f666f7263652d68747470732f6c6963656e7365)](https://packagist.org/packages/jkniest/force-https) [![StyleCI](https://camo.githubusercontent.com/14d90de84db4db80cd826f13629f44c805638452486366eb695aacf12b47ca02/68747470733a2f2f7374796c6563692e696f2f7265706f732f38303239303331372f736869656c643f6272616e63683d6d6173746572267374796c653d666c6174)](https://styleci.io/repos/80290317)

This package only does one thing: Force a connection through *https*! If a user visit the site with an unsecure "http"-Request (example: ) he will be automatically redirected to a secure route (example: http**s**://example.com)

---

Installation
------------

[](#installation)

1. In order to install the package, just run the following command in the root directory of your laravel installation:

```
composer require jkniest/force-https
```

2. If you are using **Laravel 5.4 oder below**, open the `config/app.php` file and add the following code to the `providers` array:

```
jkniest\ForceHttps\ForceHttpsServiceProvider::class,
```

3. Run the command below to copy the configuration files to your `config` folder

```
php artisan vendor:publish --tag="force-https"
```

4. Add the following line to the `.env` file

```
FORCE_HTTPS=true

```

5. Open the `app/Http/Kernel.php` file and add the following code to the `middleware` array:

```
\jkniest\ForceHttps\ForceHttps::class,
```

---

To disable the https-redirection (for example on staging servers) just change the `FORCE_HTTPS=true` in your `.env` file to `FORCE_HTTPS=false`

---

License
-------

[](#license)

The ForceHttps package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~160 days

Total

3

Last Release

3120d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15618191?v=4)[Jordan Kniest](/maintainers/jkniest)[@jkniest](https://github.com/jkniest)

---

Top Contributors

[![jkniest](https://avatars.githubusercontent.com/u/15618191?v=4)](https://github.com/jkniest "jkniest (8 commits)")

---

Tags

composerhttpslaravelpackagesecure

### Embed Badge

![Health badge](/badges/jkniest-force-https/health.svg)

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

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M220](/packages/backpack-crud)[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

1.0k508.9k2](/packages/akaunting-laravel-firewall)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21313.7k3](/packages/ecotone-laravel)

PHPackages © 2026

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