formatting

This commit is contained in:
Denis Duliçi 2021-02-17 22:38:11 +03:00
parent 043af4a602
commit 1a9fc8cfe1
2 changed files with 2 additions and 10 deletions

View File

@ -31,11 +31,7 @@ class Contact extends FormRequest
// Check if store or update // Check if store or update
if ($this->getMethod() == 'PATCH') { if ($this->getMethod() == 'PATCH') {
$model = $type; $model = $this->isApi() ? 'contact' : $type;
if ($this->isApi()) {
$model = 'contact';
}
$id = is_numeric($this->$model) ? $this->$model : $this->$model->getAttribute('id'); $id = is_numeric($this->$model) ? $this->$model : $this->$model->getAttribute('id');
} else { } else {

View File

@ -32,11 +32,7 @@ class Document extends FormRequest
// Check if store or update // Check if store or update
if ($this->getMethod() == 'PATCH') { if ($this->getMethod() == 'PATCH') {
$model = $type; $model = $this->isApi() ? 'document' : $type;
if ($this->isApi()) {
$model = 'document';
}
$id = is_numeric($this->$model) ? $this->$model : $this->{$model}->getAttribute('id'); $id = is_numeric($this->$model) ? $this->$model : $this->{$model}->getAttribute('id');
} else { } else {