Contact and Document update request fixed on Api
This commit is contained in:
parent
ddc08ddcb2
commit
043af4a602
@ -23,7 +23,6 @@ class Contact extends FormRequest
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
|
||||
$email = '';
|
||||
$required = '';
|
||||
|
||||
@ -32,7 +31,13 @@ class Contact extends FormRequest
|
||||
|
||||
// Check if store or update
|
||||
if ($this->getMethod() == 'PATCH') {
|
||||
$id = is_numeric($this->$type) ? $this->$type : $this->$type->getAttribute('id');
|
||||
$model = $type;
|
||||
|
||||
if ($this->isApi()) {
|
||||
$model = 'contact';
|
||||
}
|
||||
|
||||
$id = is_numeric($this->$model) ? $this->$model : $this->$model->getAttribute('id');
|
||||
} else {
|
||||
$id = null;
|
||||
}
|
||||
|
@ -32,7 +32,13 @@ class Document extends FormRequest
|
||||
|
||||
// Check if store or update
|
||||
if ($this->getMethod() == 'PATCH') {
|
||||
$id = is_numeric($this->$type) ? $this->$type : $this->{$type}->getAttribute('id');
|
||||
$model = $type;
|
||||
|
||||
if ($this->isApi()) {
|
||||
$model = 'document';
|
||||
}
|
||||
|
||||
$id = is_numeric($this->$model) ? $this->$model : $this->{$model}->getAttribute('id');
|
||||
} else {
|
||||
$id = null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user