Level 102
a date is year-month-day... You cant just leave the day out..
Either save it correctly (perhaps just always the 1 of the month), or use a string column
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
how to insert in database year-month only i am getting error as
SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '2020-08'
my migration file
$table->date('year_month');
my html form blade
<input name="year_month" type="month" >
controller
Model_name::create($request->all());
is there any mistake in migration file or controller help to resolve this issue
a date is year-month-day... You cant just leave the day out..
Either save it correctly (perhaps just always the 1 of the month), or use a string column
Please or to participate in this conversation.