Skip to main content

FirstOrCreate, and Other 2-in-1 Methods

Premium
4:02

The Full Lesson is Only for Premium Members

Want to access all of our courses? (36 h 00 min)

You also get:

61 courses
Premium tutorials
Access to repositories
Private Discord
Get Premium for $129/year or $29/month

Already a member? Login here

Alex Gower avatar

Upsert is cool. Thanks I have not tried it yet.

Ryan avatar

A useful feature of firstOrCreate and updateOrCreate which I use a lot is that you can pass two arrays to these methods. First array could just be a unique field to find an existing record and second array could be the remaining fields.