The Eloquent ORM is quite nice, though I\'m wondering if there is an easy way to setup MySQL transactions using innoDB in the same fashion as PDO, or if I would have to exte
If you want to avoid closures, and happy to use facades, the following keeps things nice and clean:
try {
\DB::beginTransaction();
$user = \Auth::user();
$user->fill($request->all());
$user->push();
\DB::commit();
} catch (Throwable $e) {
\DB::rollback();
}
If any statements fail, commit will never hit, and the transaction won't process.