Using closures into DB::transaction() to roll back
Laravel tip - you can provide a closure into DB::transaction() and if any errors happen, the entire transaction will be rolled back. This is great for registration if you are creating other models after the user. If anything else fails, the user won't be created.
Categories: Category 1