Skip to content

Instantly share code, notes, and snippets.

@psdtohtml5
Created August 17, 2013 13:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psdtohtml5/6256970 to your computer and use it in GitHub Desktop.
Save psdtohtml5/6256970 to your computer and use it in GitHub Desktop.
PHP : Laravel 3 Database Transactions
try {
DB::connection()->pdo->beginTransaction();
// database queries here
DB::connection()->pdo->commit();
} catch (\PDOException $e) {
// Woopsy
DB::connection()->pdo->rollBack();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment