diff --git a/.env.example b/.env.example index ba7bbc40..05707f5c 100644 --- a/.env.example +++ b/.env.example @@ -92,3 +92,4 @@ CACHE_KEY_AGENT_ALLOW=all_agent_allows CACHE_KEY_AGENT_DENY=all_agent_denies CHANNEL_NAME_SETTING=channel_setting CHANNEL_NAME_MODEL_EVENT=channel_model_event +FORCE_SCHEME= diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 1957c680..66bed42f 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -6,6 +6,7 @@ use Carbon\Carbon; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\URL; use Illuminate\Support\Facades\View; use Illuminate\Support\ServiceProvider; use Illuminate\Http\Resources\Json\JsonResource; @@ -37,8 +38,11 @@ public function boot() { global $plugin; $plugin->start(); -// JsonResource::withoutWrapping(); DB::connection(config('database.default'))->enableQueryLog(); + $forceScheme = strtolower(env('FORCE_SCHEME')); + if (env('APP_ENV') == "production" && in_array($forceScheme, ['https', 'http'])) { + URL::forceScheme($forceScheme); + } Filament::serving(function () { Filament::registerNavigationGroups([