diff --git a/.env.example b/.env.example index 29170fb7a..05601adb9 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,7 @@ APP_ENV=production APP_KEY= APP_DEBUG=false APP_URL=http://localhost +FORCE_HTTPS=false LOG_CHANNEL=stderr LOG_DEPRECATIONS_CHANNEL=null diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 811b32d14..67c844db2 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use Illuminate\Support\Facades\URL; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider @@ -25,6 +26,8 @@ public function register() */ public function boot() { - // + if (config('app.force_https')) { + URL::forceScheme('https'); + } } } diff --git a/config/app.php b/config/app.php index db6664450..552539224 100644 --- a/config/app.php +++ b/config/app.php @@ -58,6 +58,8 @@ 'asset_url' => env('ASSET_URL'), + 'force_https' => env('FORCE_HTTPS', false), + /* |-------------------------------------------------------------------------- | Application Timezone