1 回答
TA贡献1824条经验 获得超8个赞
我假设有一个带有 的按钮id="save"。
$("#save").click(function(e)
{
e.preventDefault();
const make = $("#make option:selected").val();
const model = $("#model option:selected").val();
const _token = $('input[name="_token"]').val();
$.ajax({
url:"{{route('form_for_private_sellers')}}",
method:"POST",
data:{make, _token, model},
success:function(result)
{
console.log('all done');
}
});
});
public function form_for_private_sellers(Request $request)
{
$store_seller = new Sellers();
//you may need to adjust this part as I do not know your properties called.
$store_seller->make = $request->make;
$store_seller->model = $request->model;
$store_seller->save();
}
- 1 回答
- 0 关注
- 83 浏览
添加回答
举报