PHP code example of yaroslawww / laravel-force-https
1. Go to this page and download the library: Download yaroslawww/laravel-force-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/ */
// /routes/web.php
Route::middleware('https')
->group(function() {
/** ADD ALL SECURE ROUTES INSIDE THIS GROUP **/
Route::get('/', function()
{
//
});
Route::get('test',function()
{
//
});
});
/** OTHER PAGES THAT SHOULD NOT BE SECURE **/
sh
php artisan vendor:publish --provider="ForceHttps\ServiceProvider"
sh
php artisan vendor:publish --provider="ForceHttps\ServiceProvider" --force
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.