我使用的是带有InertiaJS栈的Laravel 8。
我在路由和资源控制器上使用模型绑定。
是否可以在路由()函数上以惯性方式发送多个参数?
我无法获取this.$inertia.put(route("rooms.update", this.form));发送的请求(this.form)
这是我在控制器中的函数
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Models\Room $room
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Room $room)
{
dd($room, $request->all());
}这是vue文件上的惯性方法
this.$inertia.put(route("rooms.update", this.form));发布于 2021-06-21 15:36:12
试试这个:
this.$inertia.put(route("rooms.update", this.room), this.form);假设props中存在room,并且它是编辑室。
发布于 2021-02-09 02:28:20
nvm,我通过将其更改为以下代码来实现
this.$inertia.put(
route("rooms.update", { room: this.editingRoomUuid }),
this.form
);https://stackoverflow.com/questions/66106482
复制相似问题