Skip to content
This repository has been archived by the owner on Jul 26, 2018. It is now read-only.
/ ForceHttps Public archive

A simple laravel package to redirect all unsecure requests to secure requests

License

Notifications You must be signed in to change notification settings

jkniest/ForceHttps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Force HTTPS Middleware

Latest Stable Version Total Downloads License StyleCI

This package only does one thing: Force a connection through https! If a user visit the site with an unsecure "http"-Request (example: http://example.com) he will be automatically redirected to a secure route (example: https://example.com)


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
  1. 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,
  1. Run the command below to copy the configuration files to your config folder
php artisan vendor:publish --tag="force-https"
  1. Add the following line to the .env file
FORCE_HTTPS=true
  1. 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

The ForceHttps package is open-sourced software licensed under the MIT license.

About

A simple laravel package to redirect all unsecure requests to secure requests

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages