I wish to update table B based on source table A so that if a new record is found, we can insert it otherwise update the record if any values have changed. How would I write the query in laravel 4 using eloquent?
Table A Table B
======= =======
Name | Color Name | Color
---------------------- ----------------------
Mickey Mouse | grey Mickey Mouse | red
Donald Duck2 | green Donald Duck | blue
Donald Duck | blue Minnie | red
Goofy | black
Minnie | red
In this example table B should be inserted with the rows Goofy and Donald Duck2 and the row mickey mouse should be updated with the new color grey.