大家好,我的laravel帖子有问题..我需要您的帮助,我会给您发送一些图片
public function store(Request $request)
{
$this->validate($request,[
'nazev'=>'required',
'popis'=>'required',
'obtiznost'=>'required'
]);
$race = new competition;
$race->name = $request->input('nazev');
$race->descrption = $request->input('popis');
$race->difficulty = $request->input('obtiznost');
$race->user_id = Auth::user()->id;
$race->save();
return view('race.body');
}
答案 0 :(得分:4)
<form method="POST" action="{{ route('races.store') }}">
{{ csrf_field() }}
答案 1 :(得分:0)
打开表单后放入{{ csrf_field() }}