Answer the question
In order to leave comments, you need to log in
Is it good practice to use try/catch everywhere?
In my project, I use everywhere
try {
DB::beginTransaction();
// code...
DB::commit();
} catch (Exception $e) {
DB::rollBack();
return response()->json([
'error' => true,
'message' => $e->getMessage()
]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question