Level 88
You are doing it in the wrong order, it should be year, month, day
$date = Carbon::createFromDate($request->birthday_year, $request->birthday_month, $request->birthday_day);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have 3 select drop downs day, month, year when submitted I get 1992 12 10 I then use carbon to create date from and try and save it with my model but when I check the DB the dob is null, the field type is DATE
$dob = Carbon::createFromDate($request->birthday_year, $request->birthday_day, $request->birthday_month); $profile = new Profile; $profile->user_id = $user->id; $profile->dob = $dob;
You are doing it in the wrong order, it should be year, month, day
$date = Carbon::createFromDate($request->birthday_year, $request->birthday_month, $request->birthday_day);
Please or to participate in this conversation.