diff --git a/app/Jobs/Common/DeleteCompany.php b/app/Jobs/Common/DeleteCompany.php index 2a3647ff7..c456b7aad 100644 --- a/app/Jobs/Common/DeleteCompany.php +++ b/app/Jobs/Common/DeleteCompany.php @@ -34,8 +34,6 @@ class DeleteCompany extends Job implements ShouldDelete 'recurring', 'reports', 'settings', 'taxes', 'transactions', 'transfers', 'widgets', ]); - $this->model->users()->detach(); - $this->model->delete(); }); diff --git a/app/Jobs/Common/DeleteDashboard.php b/app/Jobs/Common/DeleteDashboard.php index 67a5d42e5..729582b7c 100644 --- a/app/Jobs/Common/DeleteDashboard.php +++ b/app/Jobs/Common/DeleteDashboard.php @@ -19,8 +19,6 @@ class DeleteDashboard extends Job implements ShouldDelete \DB::transaction(function () { $this->deleteRelationships($this->model, ['widgets']); - $this->model->users()->detach(); - $this->model->delete(); }); diff --git a/app/Utilities/Reports.php b/app/Utilities/Reports.php index 67b0f45fb..05a5dec1f 100644 --- a/app/Utilities/Reports.php +++ b/app/Utilities/Reports.php @@ -54,7 +54,7 @@ class Reports return false; } - if (($model->alias != 'core') && (new static)->moduleIsDisabled($model->alias)) { + if (! empty($model) && ($model->alias != 'core') && (new static)->moduleIsDisabled($model->alias)) { return false; } diff --git a/app/Utilities/Widgets.php b/app/Utilities/Widgets.php index b9a97a7e4..7d2ebc04b 100644 --- a/app/Utilities/Widgets.php +++ b/app/Utilities/Widgets.php @@ -65,7 +65,7 @@ class Widgets $model = Widget::where('dashboard_id', session('dashboard_id'))->where('class', $class_name)->first(); - if (($model->alias != 'core') && (new static)->moduleIsDisabled($model->alias)) { + if (! empty($model) && ($model->alias != 'core') && (new static)->moduleIsDisabled($model->alias)) { return false; } diff --git a/app/View/Components/SearchString.php b/app/View/Components/SearchString.php index ae524cb70..394bf023e 100644 --- a/app/View/Components/SearchString.php +++ b/app/View/Components/SearchString.php @@ -18,6 +18,11 @@ class SearchString extends Component /** string */ public $model; + public $skip_columns = [ + 'created_at', + 'updated_at', + ]; + /** * Create a new component instance. * @@ -47,7 +52,12 @@ class SearchString extends Component foreach ($columns as $column => $options) { // This column skip for filter - if (!empty($options['searchable'])) { + if (! empty($options['searchable'])) { + continue; + } + + // This column skip for filter + if (in_array($column, $this->skip_columns)) { continue; } diff --git a/resources/assets/js/components/AkauntingSearch.vue b/resources/assets/js/components/AkauntingSearch.vue index 14d509fd9..2c27fe295 100644 --- a/resources/assets/js/components/AkauntingSearch.vue +++ b/resources/assets/js/components/AkauntingSearch.vue @@ -31,9 +31,9 @@ - search + + search +