Laravel transaction snippet
<?php DB::beginTransaction(); try{ } catch (\Exception $e) { DB::rollBack(); throw $e; } DB::commit();