我试图提高我的编辑值,但当我点击编辑按钮,然后显示这个错误。
这里是我的代码:
<form action="{{ isset($category) ? route('categories.update'.
$category->id):route('categories.store')}}" method="POST">
@csrf
<div class="form-group mx-3">
<label for="name" >Name</label>
<input type="text" id="name" class="form-control" name="name" value=" {{isset($category)?
$category->name:''}} ">
</div>
<div class="form-group mx-3">
<button class="btn btn-success">Add category</button>
</div>发布于 2021-04-16 07:25:06
您有语法错误
route('categories.update'. $category->id)
至
route('categories.update',$category->id)
删除.并使用,
放置.,这意味着并发,这就是为什么您获得categories.update1] not defined.这个错误,您可以使用1 id与categories.update连接
发布于 2021-04-16 06:58:54
修复您的路由名称,不要连接它,而是将它包装成数组。
route('categories.update', ['category' => $category->id]) : route('categories.store')https://stackoverflow.com/questions/67120461
复制相似问题