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

AbandonedArchivedLibrary

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 2mo ago

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 64% 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

3074d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7fb77ee357245e247ed582cdb6cc071a60317842f88291262d473cc82e8d8eab?d=identicon)[jkniest](/maintainers/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

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

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