From 1a9fc8cfe132dc8dc5be39501c3d4b6b3bd0d95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Wed, 17 Feb 2021 22:38:11 +0300 Subject: [PATCH] formatting --- app/Http/Requests/Common/Contact.php | 6 +----- app/Http/Requests/Document/Document.php | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/app/Http/Requests/Common/Contact.php b/app/Http/Requests/Common/Contact.php index 200783ca8..1c93fcb3c 100644 --- a/app/Http/Requests/Common/Contact.php +++ b/app/Http/Requests/Common/Contact.php @@ -31,11 +31,7 @@ class Contact extends FormRequest // Check if store or update if ($this->getMethod() == 'PATCH') { - $model = $type; - - if ($this->isApi()) { - $model = 'contact'; - } + $model = $this->isApi() ? 'contact' : $type; $id = is_numeric($this->$model) ? $this->$model : $this->$model->getAttribute('id'); } else { diff --git a/app/Http/Requests/Document/Document.php b/app/Http/Requests/Document/Document.php index ded651f33..e04e8706c 100644 --- a/app/Http/Requests/Document/Document.php +++ b/app/Http/Requests/Document/Document.php @@ -32,11 +32,7 @@ class Document extends FormRequest // Check if store or update if ($this->getMethod() == 'PATCH') { - $model = $type; - - if ($this->isApi()) { - $model = 'document'; - } + $model = $this->isApi() ? 'document' : $type; $id = is_numeric($this->$model) ? $this->$model : $this->{$model}->getAttribute('id'); } else {