PHP code example of novay / laravel-https

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

    

novay / laravel-https example snippets


        'providers' => [
        ...
            Novay\ForceHttps\ForceHttpsServiceProvider::class,
        ];
    

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

    Route::get('/', 'WelcomeController@welcome')->middleware('https');

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
       $this->middleware('https');
    }
bash
        php artisan vendor:publish --tag=laravel-https