Joke Collection Website - Blessing messages - What's the difference between laravel's firstOrCreate and firstOrNew?

What's the difference between laravel's firstOrCreate and firstOrNew?

After the data is not queried according to the conditions, FirstOrCreate sends the insert command back to the database to create a piece of data.

FirstOrNew does not really insert a new record into the database, but creates an eloquent object of the new record and returns it, and can control whether it is necessary to store the new object in the database.

Simply put, firstOrCreate is equivalent to firstOrNew first, and then saving the returned object to the database.