如何在“存储”方法中调用“创建”方法并将其传递给带有数据的自定义请求?
public function create(createUserRegForm $request) {
$validated = $request->validated();
return view('pages.user-form', ['user_id' => $validated['user_id']);
}
public function store(Request $request) {
// -- code --
$new_request = new createUserRegForm(['user_id' => $response]);
$this->create($new_request);
}
尝试上面的代码给我一个错误: