Last active
January 15, 2022 13:46
-
-
Save frikishaan/250ad0826aa90af1e7fe6eda7e2d5868 to your computer and use it in GitHub Desktop.
Force HTTPS in Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
/* | |
* Put this code in routes/web.php file | |
*/ | |
use Illuminate\Support\Facades\URL; | |
if(env('APP_ENV') == "production"){ | |
URL::forceScheme('https'); | |
} | |
// Your routes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment