I have three dropdowns for Day, Month, and year for Date of Birth Data and one column dob in the database. I want to convert selected data into the date of birth format then stored in the database. this is creating syntax error.
my controller code :
protected function create(array $data)
{
'month' => $data['month'],
'day' => $data['day'],
'year' => $data['year'],
return User::create([
'first_name' => $data['first_name'],
'last_name' => $data['last_name'],
'gender' =>$data['gender'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'phone' => $data['phone'],
'dob' => "month/day/year",
]);
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire