Downloads
Stars
Version
This package provides a laravel middleware to force https redirect.
##Requires
You can install the package via composer:
$ composer require padosoft/laravel-https
No additional steps required because the service provider use new L5.5+ autodiscovery feature.
You must install this service provider.
// config/app.php
'provider' => [
...
Padosoft\Laravel\Https\LaravelHttpsServiceProvider::class,
...
];
Optionally publish the packages config file by running the following from your projects root folder:
php artisan vendor:publish --tag=laravel-https
Add the middleware to your routes or controller. See Usage.
You can include the HttpsForce in a route groups or on individual routes.
Route::group(['middleware' => ['web', 'HttpsForce']], function () {
Route::get('/', 'WelcomeController@welcome');
});
Route::get('/', 'WelcomeController@welcome')->middleware('HttpsForce');
Route::match(['post'], '/test', 'Testing\TestingController@runTest')->middleware('HttpsForce');
You can include the HttpsForce in the constructor of your controller file.
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('HttpsForce');
}
Please see CHANGELOG for more information what has changed recently.
$ composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email instead of using the issue tracker.
Padosoft (https://www.padosoft.com) is a software house based in Florence, Italy. Specialized in E-commerce and web sites.
The MIT License (MIT). Please see License File for more information.