Laravel 5.1 LaravelCollective Forms 操作正在加载为 HTTP 而不是 HTTPS
Laravel 5.1 with LaravelCollective Forms actions are loading as HTTP instead of HTTPS
我正在使用 LaravelCollective HTML 模块向某些视图添加表单。问题是表单中的操作是在 HTTP url 而不是 HTTPS 上生成的。有没有办法让它只使用页面加载的任何协议,而不必在表单调用中明确拼出每个绝对 URL ?这是我在视图中使用的表单标记的示例:
{!! Form::model(Auth::user(),['route','step1.post']) !!}
route
辅助函数将根据 routes.php
.
中定义的路由名称生成正确的 url(包括 http/https 协议)
例如尝试
Route::post('/user', ['https', 'UserController@post'])->name('step1.post');
在routes.php
,然后
{!! Form::model(Auth::user(), ['url' => route('step1.post')]) !!}
在你看来。
我正在使用 LaravelCollective HTML 模块向某些视图添加表单。问题是表单中的操作是在 HTTP url 而不是 HTTPS 上生成的。有没有办法让它只使用页面加载的任何协议,而不必在表单调用中明确拼出每个绝对 URL ?这是我在视图中使用的表单标记的示例:
{!! Form::model(Auth::user(),['route','step1.post']) !!}
route
辅助函数将根据 routes.php
.
例如尝试
Route::post('/user', ['https', 'UserController@post'])->name('step1.post');
在routes.php
,然后
{!! Form::model(Auth::user(), ['url' => route('step1.post')]) !!}
在你看来。