我在MongoDb数据库中有3个子文档
这是代码:
public function store(Request $request)
{
$this->validate($request,[
//Personal Detail
'firstName' => 'required',
'middleName' => 'required',
'lastName' => 'required',
'dateOfBirth' => 'required',
'gender' => 'required',
'mobileNumber' => 'required',
'localAddress' => 'required',
'parmanentAddress' => 'required',
'emailId' => 'required',
'city' => 'required',
//Company Detail
'email' => 'required',
'password' => 'required',
'employeeId' => 'required',
'department' => 'required',
'designation' => 'required',
'dateOfJoining' => 'required',
'salary' => 'required',
//Bank Detail
'accountHolderName' => 'required',
'accountNumber' => 'required',
'bankName' => 'required',
'ifscCode' => 'required',
'panNumber' => 'required',
'branchName' => 'required'
]);
$employee = new Employee();
}
我在laravel中进行编码,提交表单时,如何在所有3个子文档中插入所有记录?