rest controller

This commit is contained in:
Kavalar 2024-12-16 13:14:28 +03:00
parent 1d7ed112a7
commit 625089acd1

View File

@ -94,8 +94,10 @@ class RestController
$model = $this->model->where('id', $id)->first();
foreach ($model->getFillable() as $item){
if (!empty($data[$item])){
$model->{$item} = $data[$item] ?? null;
}
}
$model->save();
$this->renderApi($model->toArray());