PHP code example of padosoft / laravel-https

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

    

padosoft / laravel-https example snippets

 php
// config/app.php
'provider' => [
    ...
    Padosoft\Laravel\Https\LaravelHttpsServiceProvider::class,
    ...
];
bash
    php artisan vendor:publish --tag=laravel-https
 php
    Route::group(['middleware' => ['web', 'HttpsForce']], function () {
        Route::get('/', 'WelcomeController@welcome');
    });
 php
    Route::get('/', 'WelcomeController@welcome')->middleware('HttpsForce');
    Route::match(['post'], '/test', 'Testing\TestingController@runTest')->middleware('HttpsForce');
 php
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
       $this->middleware('HttpsForce');
    }