I'm building an application in Laravel 4 and I need to run several queries as UPDATE OR INSERT queries to avoid PK violations on duplicate inserts. I haven't been able to find any way to do this with the query builder in Laravel.
Can I modify the DB class or something similar? Or will I need to just write pure SQL statements?
Now we can use User::updateOrCreate()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With