app force https

This commit is contained in:
Edward Yang 2022-08-31 11:06:19 +08:00
parent 5fa4492c8e
commit 167ee5c1df
2 changed files with 6 additions and 1 deletions

View File

@ -4,6 +4,8 @@ APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_TIMEZONE=PRC
APP_FORCE_HTTPS=false
ASSET_URL=http://localhost
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null

View File

@ -2,6 +2,7 @@
namespace App\Providers;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@ -23,6 +24,8 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
if (env('APP_FORCE_HTTPS', false)) {
URL::forceScheme('https');
}
}
}