https://www.w3schools.com/sql/func_mysql_date_format.asp
Or just store the dates in a format mySQL is happy with and create accessors/mutators for them.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to save date in 15-12-2018 format..
but error is
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '25-03-2018' for column 'start_date' at row 1 (SQL: insert into batches (batch_name, start_date, end_date, status, updated_at, created_at) values (Batch 2018, 25-03-2018, 27-04-2018, 1, 2018-04-13 11:25:49, 2018-04-13 11:25:49))
use Carbon and you can manipulate your date however you want
use Carbon\Carbon;
$date = Carbon::parse($request->start_date);
Please or to participate in this conversation.