Added delete last category exception class
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Jobs\Setting;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Exceptions\Settings\LastCategoryDelete;
|
||||
use App\Interfaces\Job\ShouldDelete;
|
||||
use App\Models\Setting\Category;
|
||||
|
||||
@@ -28,7 +29,7 @@ class DeleteCategory extends Job implements ShouldDelete
|
||||
if (Category::where('type', $this->model->type)->count() == 1) {
|
||||
$message = trans('messages.error.last_category', ['type' => strtolower(trans_choice('general.' . $this->model->type . 's', 1))]);
|
||||
|
||||
throw new \Exception($message);
|
||||
throw new LastCategoryDelete($message);
|
||||
}
|
||||
|
||||
if ($relationships = $this->getRelationships()) {
|
||||
|
||||
Reference in New Issue
Block a user