I have some code like this
$editStuState = StuAtt::where(\'studentId\' , \'=\' , $id)->first();
$editStuState -> leave +=1;
$editStuState -
If your Database is Postgres and your field is Timestamp sometimes Carbon cannot convert to default format (without milliseconds).
If milliseconds is not needed, update field content to not have the millisecond part.
UPDATE YOURTABLE SET created_at = date_trunc('seconds', created_at),
updated_at = date_trunc('seconds', updated_at)
This will normalize timestamped fields without milliseconds.