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()
|
public function rules()
|
||||||
{
|
{
|
||||||
|
|
||||||
$email = '';
|
$email = '';
|
||||||
$required = '';
|
$required = '';
|
||||||
|
|
||||||
@ -32,7 +31,13 @@ class Contact extends FormRequest
|
|||||||
|
|
||||||
// Check if store or update
|
// Check if store or update
|
||||||
if ($this->getMethod() == 'PATCH') {
|
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 {
|
} else {
|
||||||
$id = null;
|
$id = null;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,13 @@ class Document extends FormRequest
|
|||||||
|
|
||||||
// Check if store or update
|
// Check if store or update
|
||||||
if ($this->getMethod() == 'PATCH') {
|
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 {
|
} else {
|
||||||
$id = null;
|
$id = null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user