rest controller
This commit is contained in:
parent
1d7ed112a7
commit
625089acd1
@ -94,7 +94,9 @@ class RestController
|
|||||||
$model = $this->model->where('id', $id)->first();
|
$model = $this->model->where('id', $id)->first();
|
||||||
|
|
||||||
foreach ($model->getFillable() as $item){
|
foreach ($model->getFillable() as $item){
|
||||||
$model->{$item} = $data[$item] ?? null;
|
if (!empty($data[$item])){
|
||||||
|
$model->{$item} = $data[$item] ?? null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$model->save();
|
$model->save();
|
||||||
|
Loading…
Reference in New Issue
Block a user