PHPackages                             phucnguyenvn/laravel-force-https-middleware - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. phucnguyenvn/laravel-force-https-middleware

ActiveLibrary[HTTP &amp; Networking](/categories/http)

phucnguyenvn/laravel-force-https-middleware
===========================================

Laravel module which force all request to https protocol

v1.0(7y ago)181BSD-3-ClausePHPPHP &gt;=5.4.0CI failing

Since May 7Pushed 6y ago1 watchersCompare

[ Source](https://github.com/phucnguyenvn/laravel-force-https-middleware)[ Packagist](https://packagist.org/packages/phucnguyenvn/laravel-force-https-middleware)[ RSS](/packages/phucnguyenvn-laravel-force-https-middleware/feed)WikiDiscussions master Synced 4w ago

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

Force https in Laravel
======================

[](#force-https-in-laravel)

Laravel module which force all request to https protocol

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

[](#installation)

Installing via Composer

```
composer require phucnguyenvn/laravel-force-https-middleware
```

### Usage

[](#usage)

To get started apply this middleware to every request adding setting the rule at **Kernel.php** file, like so:

Example:

```
/**
 * The application's global HTTP middleware stack.
 *
 * These middleware are run during every request to your application.
 *
 * @var array
 */
protected $middleware = [
    \App\Http\Middleware\CheckForMaintenanceMode::class,
    \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
    \App\Http\Middleware\TrimStrings::class,
    \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
    \App\Http\Middleware\TrustProxies::class,

    // Appending custom middleware
    \PhucNguyenVn\Http\Middleware\ForceHttps::class
];
```

Now the middleware will redirect every request to https if:

The current request comes with no secure protocol (http) If your environment is equals to production.

Test
----

[](#test)

```
composer test
```

Credits
-------

[](#credits)

- [Phuc Nguyen](https://github.com/phucnguyenvn)
- [Ngoc Linh Pham](https://github.com/pnlinh)

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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

Unknown

Total

1

Last Release

2656d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/26a38fa89a54d7c6fafe110ce06fe84c67f4ec06c24b6480b4564c982e38f830?d=identicon)[phucnguyenvn](/maintainers/phucnguyenvn)

---

Top Contributors

[![phucnguyenvn](https://avatars.githubusercontent.com/u/19264169?v=4)](https://github.com/phucnguyenvn "phucnguyenvn (3 commits)")[![pnlinh](https://avatars.githubusercontent.com/u/26193890?v=4)](https://github.com/pnlinh "pnlinh (1 commits)")

---

Tags

httpsmiddlewarelaravel

### Embed Badge

![Health badge](/badges/phucnguyenvn-laravel-force-https-middleware/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M307](/packages/laravel-ai)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8723.3M27](/packages/yajra-laravel-oci8)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)

PHPackages © 2026

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