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 2w 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 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

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

2611d 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.1M337](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

59156.3k11](/packages/api-platform-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M123](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)

PHPackages © 2026

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