Laravel路线发布错误我已经尝试了一切

时间:2019-01-21 10:09:55

标签: laravel

大家好,我的laravel帖子有问题..我需要您的帮助,我会给您发送一些图片

Laravel Error My Form

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');
}

2 个答案:

答案 0 :(得分:4)

<form method="POST" action="{{ route('races.store') }}">
    {{ csrf_field() }}

答案 1 :(得分:0)

打开表单后放入{{ csrf_field() }}