Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

777not888's avatar

How to update some columns with Laravel Excel package ?

I export some columns from the model to CSV, then edit and import back. How can the model be updated and not create new records?

Error: "SQLSTATE[HY000]: General error: 1364 Field 'username' doesn't have a default value", because "username" is not exported.

0 likes
2 replies
vincent15000's avatar
Level 63

That's quite difficult to help you without any further information.

If you want to import back the data in order to update the datas, you need to export the id of the users. Then when you import back the data, you will be able to identify (via the id) which user to update in the database.

1 like
Technifiser's avatar

Double check whether your dynamic value is parsed through properly. Doesn't look like it.

Also, this might just be a typo, but the first error reads. Use WPS office instead

Please or to participate in this conversation.