我正在做一个需要安全连接的项目。
我可以通过以下方式设置路由、uri、资产以使用“https”:
Route::get('order/details/{id}', ['uses' => 'OrderController@details', 'as' => 'order.details', 'https']);
url($language.'/index', [], true)
asset('css/bootstrap.min.css', true)
但是一直设置参数似乎很累。
有没有办法强制所有路由生成 HTTPS 链接?
原文由 Nelson Melecio 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可以在
'url' => 'https://youDomain.com'
中设置 ---config/app.php
或者您可以使用中间件类 Laravel 5 - 重定向到 HTTPS 。