If the record does not exist, it is created, but if it exists, we would then update the vote column of the users table with 2, which is what the second array is carrying. In the first conditional array, we are checking to see if the record exist in the table. Push your web development skills to the next level, through expert screencasts on PHP, Laravel, Vue, and much more. After that, we then chain the updateOrInsert()to it, and in the updateOrInsert() we pass a conditional array. ![]() Look up my shot on How to use the table() for better understanding of the table() query builder.īasically, we locate the table we want to update or insert the record into using the table(). In this post, we have different methods and.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |