From cb94973bd1d263993a8c74377ee1220b79cb766c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 8 Nov 2023 19:54:26 +1100 Subject: [PATCH] Remove trait --- app/Helpers/Document/WithTypeHelpers.php | 31 ------------------------ app/Models/Document.php | 15 +++++++++++- 2 files changed, 14 insertions(+), 32 deletions(-) delete mode 100644 app/Helpers/Document/WithTypeHelpers.php diff --git a/app/Helpers/Document/WithTypeHelpers.php b/app/Helpers/Document/WithTypeHelpers.php deleted file mode 100644 index 9f2776a16abb..000000000000 --- a/app/Helpers/Document/WithTypeHelpers.php +++ /dev/null @@ -1,31 +0,0 @@ -type, ['png', 'jpeg', 'jpg', 'tiff', 'gif'])) { - return true; - } - - return false; - } - -} diff --git a/app/Models/Document.php b/app/Models/Document.php index 3c73e40d2963..636609058bff 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -64,7 +64,6 @@ class Document extends BaseModel { use SoftDeletes; use Filterable; - use WithTypeHelpers; const DOCUMENT_PREVIEW_SIZE = 300; // pixels @@ -234,4 +233,18 @@ class Document extends BaseModel } + /** + * Returns boolean based on checks for image. + * + * @return bool + */ + public function isImage(): bool + { + if (in_array($this->type, ['png', 'jpeg', 'jpg', 'tiff', 'gif'])) { + return true; + } + + return false; + } + }