Google News
logo
Laravel - Interview Questions
What is the use of the updateOrinsert() method in Laravel?
This method is used to update an existing record in a database if the condition is matched or created if there is no matching record. It will return the boolean value. 
 
You can use the following syntax :
DB::table('blogs')->updateOrInsert([Conditions],[fields with value]);
Advertisement