laractive/laravel-https

Laravel HTTPS Package

Downloads

68

Stars

0

Version

v1.0.1

Laravel HTTPS Package

Latest Version on Packagist Total Downloads Last Commit Issues License

Logo

Laravel package to use HTTPS secure protocol as middleware.

Installation

You can install the package via composer:

composer require laractive/laravel-https

You're done. All none HTTP routes are now redirected to HTTPS.

Configuration

You can publish config file if needed:

php artisan vendor:publish --tag=https-config

By default, the HTTPS protocol will be forced to all routes in all environments. You can disable this behavior.

  • In your (.env) environment file, add these lines:
## HTTPS
HTTPS_GLOBAL_MIDDLEWARE=false
  • Or in your published (config/https.php) config file:
'global_middleware' => false,

If you want to exclude one or more environments, you have to publish the config file and then add the excluded environments.

'excluded_environments' => [
    'local',
],

Usage

If you have disabled global middleware, you can add "https" middleware to any route.

Route::get('/', function () {
    //
})->middleware('https');

Route::middleware('https')->group(function () {
    //
});

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

laractive

Author

laractive