Update a table using Maatwebsite Excel Import based on condition #3064
Replies: 1 comment
-
Use Collection instead of ToModel |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
noblemfd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Using Laravel-5.8 and Maatwebsite-3.1, I have a table called employees (Employee).
I want to use the excel upload to update these two (2) fields: email and department_id for each of the employees where:
company_id = Auth::user()->company_id AND employee_code = $row['employee_code'].
Also, it should only perform the update for those that meet the condition. I should only perform update and don't crete.
How do I achieve this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions