代码改变世界

Bagisto电商系统在生产环境解决http未转https错误

2025-05-06 22:19  狼人:-)  阅读(25)  评论(0)    收藏  举报

https://github.com/bagisto/bagisto/issues/1692

.env

# APP_ENV=local
APP_ENV=production

 

/app/Providers/AppServiceProvider.php

public function boot(): void
    {
        //$this->app['request']->server->set('HTTPS', true);
        if (env('APP_ENV') !== 'local') {
            \URL::forceScheme('https');
        }

        ParallelTesting::setUpTestDatabase(function (string $database, int $token) {
            Artisan::call('db:seed');
        });
    }