PHPackages                             jsefton/laravel-protocol - 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. jsefton/laravel-protocol

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

jsefton/laravel-protocol
========================

Handles detection of http protocol and changes internal links and redirects

1.0.0(6y ago)121MITPHP

Since Apr 6Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jsefton/laravel-protocol)[ Packagist](https://packagist.org/packages/jsefton/laravel-protocol)[ Docs](https://github.com/jsefton/laravel-protocol)[ RSS](/packages/jsefton-laravel-protocol/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Laravel Protocol
================

[](#laravel-protocol)

Handles detection of http protocol and changes internal links and redirects to match.

### Installation

[](#installation)

You will need composer to install this package (get composer). Then run:

```
composer require jsefton/laravel-protocol
```

#### Register Service Provider

[](#register-service-provider)

Add the below into your `config/app.php` within `providers` array

```
JSefton\Protocol\ProtocolServiceProvider::class

```

After installation you will need to publish the config file. To do this run:

```
php artisan vendor:publish --tag=protocol.config
```

This will create the file `config/protocol.php` where you can configure the settings.

### Configuration

[](#configuration)

#### `auto`

[](#auto)

If set to true this will automatically match the internal links to the current users protocol.

#### `protocol`

[](#protocol)

If set this will force internal links and redirect users to the set protocol. Accepted values are `http` or `https`. Leave blank to not set.

#### `environments`

[](#environments)

You can add your own name for environments within this array. The key of the array should match your used `APP_ENV` values for it to detect correctly.

Within each environment you can set `https` to `true` or `false`. If `true` this will change all internal linking to `https`. If you set `redirect` to `true` then this will force all users to `https`, but only if you have set `https` to `true`.

##### Example Config

[](#example-config)

```
/**
 * Automatically detect based on current protocol
 */
'auto' => false,

/**
 * Force everything to a set protocol either
 * 'http' or 'https'. If blank then won't
 * force anything. Ignored if 'auto' is true.
 */
'protocol' => '',

/**
 * Use different rules per environment
 * Ignored if 'auto' is true or 'protocol' is set.
 */
'environments' => [
    'local' => [
        'https' => false,
        'redirect' => false
    ],
    'production' => [
        'https' => true,
        'redirect' => false
    ]
]
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2224d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41b413127c7499a63bcb5c5ae903bd8961ba29300b6ccbda873e0c4bf06d0a02?d=identicon)[jsefton](/maintainers/jsefton)

---

Top Contributors

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

---

Tags

httpphphttpslaravelprotocolsslredirectdetect

### Embed Badge

![Health badge](/badges/jsefton-laravel-protocol/health.svg)

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

###  Alternatives

[padraic/humbug_get_contents

Secure wrapper for accessing HTTPS resources with file\_get\_contents for PHP 5.3+

1255.3M5](/packages/padraic-humbug-get-contents)[sockeon/sockeon

Framework-agnostic PHP WebSocket and HTTP server library with attribute-based routing and support for namespaces and rooms.

291.3k2](/packages/sockeon-sockeon)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)[akhan619/laravel-ses-tracking

A Laravel artisan based package to create the AWS (SES + SNS) infrastructure to receive email event notifications with Http/Https endpoint.

149.9k](/packages/akhan619-laravel-ses-tracking)[akhan619/laravel-ses-event-manager

A Laravel package to manage incoming SES email events with http/s webhooks.

148.8k](/packages/akhan619-laravel-ses-event-manager)[josantonius/url

PHP library to access URL information.

123.2k2](/packages/josantonius-url)

PHPackages © 2026

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