Skip to content

Instantly share code, notes, and snippets.

@frikishaan
Last active January 15, 2022 13:46
Show Gist options
  • Save frikishaan/250ad0826aa90af1e7fe6eda7e2d5868 to your computer and use it in GitHub Desktop.
Save frikishaan/250ad0826aa90af1e7fe6eda7e2d5868 to your computer and use it in GitHub Desktop.
Force HTTPS in Laravel
<?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