我设计了表单来在 Laravel 中保存数据
这个问题向我展示了以下错误
此集合实例上不存在属性 [id]。
这是我的代码
控制器
public function create ()
{
$post = Post::all();
return view ("post.create",compact('post'));
}
查看 create.blade.php
<form action="{{url()->action ('PostController@store', ['id'=>$post->id])}}" method="POST">
<input type="text" name="title" placeholder="Write Title">
<input type="text" name="body" placeholder="Write Body">
<input type="submit" value="Submit" name="submit">
</form>
我知道问题出在这里,但我不知道我能做什么
'PostController@store', ['id'=>$post->id])}}" method="POST"
慕尼黑5688855
牧羊人nacy
慕虎7371278