close #2799 Fixed: Company delete can not delete sub categories

This commit is contained in:
Cüneyt Şentürk
2022-12-07 11:43:38 +03:00
parent cba5dd519c
commit 86a44fb3e5
13 changed files with 186 additions and 28 deletions

View File

@@ -3,6 +3,8 @@
namespace App\Jobs\Setting;
use App\Abstracts\Job;
use App\Events\Setting\CategoryUpdated;
use App\Events\Setting\CategoryUpdating;
use App\Interfaces\Job\ShouldUpdate;
use App\Models\Setting\Category;
@@ -12,10 +14,14 @@ class UpdateCategory extends Job implements ShouldUpdate
{
$this->authorize();
event(new CategoryUpdating($this->model, $this->request));
\DB::transaction(function () {
$this->model->update($this->request->all());
});
event(new CategoryUpdated($this->model, $this->request));
return $this->model;
}