Laravel 5.2:url()函数返回;https";网址?

Laravel 5.2:url()函数返回;https";网址?,laravel,url,https,laravel-5.2,Laravel,Url,Https,Laravel 5.2,我使用的是Laravel5.2。下面是在我的一个视图(刀片)文件中使用url()的一个示例: .. .. 它会返回非https URL,如: http://www.example.com/register 我需要它是HTTPS。我已经在我的网站上使用了有效的HTTPS 在我的.env文件中,它已经是: APP\u URL=https://www.example.com 在我的config/app.php中,它已经是: 'url'=>env('APP_url','https://www.exa

我使用的是
Laravel5.2
。下面是在我的一个视图(刀片)文件中使用
url()
的一个示例:


..
..
它会返回非https URL,如:
http://www.example.com/register

我需要它是HTTPS。我已经在我的网站上使用了有效的HTTPS

在我的
.env
文件中,它已经是:
APP\u URL=https://www.example.com

在我的
config/app.php
中,它已经是:
'url'=>env('APP_url','https://www.example.com),

那么我还需要为
LV 5.2
配置什么才能通过
url()
helper函数返回HTTPS url呢

谢谢。

您只需使用
安全url()


..
..
<form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
..
..
</form>
<form class="form-horizontal" role="form" method="POST" action="{{ secure_url('/register') }}">
..
..
</form>