PHP code example of jeremykenedy / laravel-https

1. Go to this page and download the library: Download jeremykenedy/laravel-https 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/ */

    

jeremykenedy / laravel-https example snippets


        'providers' => [
        ...
            jeremykenedy\LaravelHttps\LaravelHttpsServiceProvider::class,
        ];
    

    Route::group(['middleware' => ['web', 'checkHTTPS']], function () {
        Route::get('/', 'WelcomeController@welcome');
    });

    Route::get('/', 'WelcomeController@welcome')->middleware('checkHTTPS');
    Route::match(['post'], '/test', 'Testing\TestingController@runTest')->middleware('forceHTTPS');

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
       $this->middleware('forceHTTPS');
    }
bash
        php artisan vendor:publish --tag=LaravelHttps
    
bash
LARAVEL_HTTP_ERROR_CODE=403
bash
├── .gitignore
├── LICENSE
├── README.md
├── composer.json
└── src
    ├── LaravelHttpsServiceProvider.php
    ├── app
    │   └── Http
    │       └── Middleware
    │           ├── CheckHTTPS.php
    │           └── ForceHTTPS.php
    ├── config
    │   └── laravel-https.php
    └── resources
        ├── lang
        │   └── en
        │       └── laravel-https.php
        └── views
            └── errors
                └── 403.blade.php