added db transaction to jobs
This commit is contained in:
@ -26,12 +26,14 @@ class CancelBill extends Job
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->deleteRelationships($this->bill, [
|
||||
'transactions', 'recurring'
|
||||
]);
|
||||
\DB::transaction(function () {
|
||||
$this->deleteRelationships($this->bill, [
|
||||
'transactions', 'recurring'
|
||||
]);
|
||||
|
||||
$this->bill->status = 'cancelled';
|
||||
$this->bill->save();
|
||||
$this->bill->status = 'cancelled';
|
||||
$this->bill->save();
|
||||
});
|
||||
|
||||
return $this->bill;
|
||||
}
|
||||
|
Reference in New Issue
Block a user