From 741252a846590bcba01497e05e847ceafb8c66a6 Mon Sep 17 00:00:00 2001 From: Dennis Elsinga Date: Sat, 30 Mar 2024 12:04:43 +0100 Subject: [PATCH] refactor: Simplify condition checks in FilamentResourceTestsCommand --- src/Commands/FilamentResourceTestsCommand.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/FilamentResourceTestsCommand.php b/src/Commands/FilamentResourceTestsCommand.php index 38e22ad3..dffe9438 100644 --- a/src/Commands/FilamentResourceTestsCommand.php +++ b/src/Commands/FilamentResourceTestsCommand.php @@ -212,14 +212,14 @@ protected function getStubs(Resource $resource): array } // Check if there is a trashed filter - if ($this->getResourceTableFilterNames($resourceTable)->contains('trashed')) { + if ($this->getResourceTableFilterNames($resourceTable)->contains('trashed') && $this->hasSoftDeletes($resource)) { // Check if there is a restore action - if ($this->hasSoftDeletes($resource) && $this->getResourceTableActionNames($resource)->contains('restore')) { + if ($this->getResourceTableActionNames($resource)->contains('restore')) { $stubs[] = 'Restore'; } // Check if there is a bulk restore action - if ($this->hasSoftDeletes($resource) && $this->getResourceTableBulkActionNames($resource)->contains('restore')) { + if ($this->getResourceTableBulkActionNames($resource)->contains('restore')) { $stubs[] = 'BulkRestore'; } }