📜  laravel 混合内容错误 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:04.840000             🧑  作者: Mango

代码示例1
When changing from http to https, it's possible to get the problem Mixed content issue - Content must be served as HTTPS.

So, first modify APP_URL in the .env file, if we use the assets helper, this shouldn't give any problem with the URL.

APP_URL=https://mydomain.com

Finally, add the following to the beginning of api.php or web.php:

if (App::environment('production')) {
    URL::forceScheme('https');
}