You can use Carbon to parse the date and pass it to the database in the required format:
// assuming the data comes from the Request object, change if appropriate
$invduedate = Carbon::createFromFormat('d/m/Y', $request-> invduedate);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
hi
I am facing a issue called incorrect date value in controller file
Invalid datetime format: 1292 Incorrect date value: '10/10/2018' for column 'invduedate' at row 1 (SQL: insert into invoice(custid,compid,invduedate) values('5','1','10/10/2018'))
i want to know is there any function for this?
Please or to participate in this conversation.