When you want to rollback a set of database operations if one of them fails, you can execute them within a database transaction. Imagine, you have a database with 10.000 users and want to inactivate all users that don't have a subscription. When the update query is executing, something may fail, and you can end up with inconsistent results in you users table.
When you only are adding a single statement to a transaction, Laravel provides three shorthand methods, saveOrFail, updateOrFail, and deleteOrFail.
Let's look at the definition of saveOrFail: The save method, is added to a transaction when executed by saveOrFail.