14four/laravel-force-https
Force HTTPs for domains
Package info
bitbucket.org/14fourdev/laravel-force-https
Type:laravel-package
pkg:composer/14four/laravel-force-https
Requires
None
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ^3.7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
MIT 693238d2bdba83ccbd48c3e6a7b88c2b86c06586
- Josh Hagel <josh.woop@14four.com>
This package is not auto-updated.
Last update: 2026-06-20 17:02:23 UTC
README
Installation
- Require Laravel Force HTTPS with composer.
composer require 14four/laravel-force-https
- Open your config/app.php and add the following to the providers array:
note: Laravel > 5.5 skip this step
FourteenFour\ForceHttps\ForceHttpsServiceProvider::class,
- Publish Config
php artisan vendor:publish --provider="FourteenFour\ForceHttps\ForceHttpsServiceProvider"
- Add middleware to kernel.php
\FourteenFour\ForceHttps\Middleware\ForceHttps::class,
note: this should probably be added to the 'web' middleware
Config
Open the config/forcehttps.php configuration file to customize the config.
Enable
enable will allow you to turn on and off the force HTTPS functionality of the middleware.
By default this uses the environment variable FORCE_HTTPS.
Use the following to disable the force HTTPS functionality.
FORCE_HTTPS=false
Except
This will allow you to provide regex patterns that will be excluded from the force HTTPS functionality.
Example:
$except = [
'14four.com',
],
Keep in mind this will match the fullUrl not just the domain. The example above will match http://14four.com and http://example.com/post?14four.com
