PHP code example of markohs / forcehttps

1. Go to this page and download the library: Download markohs/forcehttps library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

markohs / forcehttps example snippets


Route::get('/','StaticPageController@getRoot')->middleware('forcehttps');


	'autoregister' => ['web']

...
'web' => [
    \App\Http\Middleware\EncryptCookies::class,
...
    \Markohs\ForceSSL\Middleware\ForceHTTPS::class,
...

    \Illuminate\Routing\Middleware\SubstituteBindings::class,
],
...

    'enabled_environments' => ['stage', 'prod', 'production'],

    'whitelist' => [
        'example/url',
        'example2'
    ],


$  php artisan vendor:publish --tag=forcehttps.config