【发布时间】:2014-03-11 11:19:00
【问题描述】:
有没有办法使用刀片语法通过 https 提交表单?
我有 {{Form::open(['route' => 'pages.store', 'class' => 'crud-form'])}} 但这使用 http://
【问题讨论】:
有没有办法使用刀片语法通过 https 提交表单?
我有 {{Form::open(['route' => 'pages.store', 'class' => 'crud-form'])}} 但这使用 http://
【问题讨论】:
尝试强制您的路线安全
Route::post('page/store', array('https', 'as' => 'pages.store');
【讨论】:
更好的方法是保护路线本身而不是形式,也许是这样的
Route::post('/pages', [
'https' => true
'as' => 'pages.store'
'uses' => 'PagesController@store''
]);
或
Route::group(['https'], function()
{
// ur routes
});
查看http://laravel.io/forum/12-26-2014-routing-with-https 和https://github.com/laravel/framework/issues/578 了解更多信息。
【讨论】:
保护路线对我没有用。相反,我在boot() 方法中将以下内容添加到我的AppServiceProvider 中:
// forces use of https instead of http
URL::forceScheme('https');
【讨论】: