rest controller
This commit is contained in:
		| @@ -94,8 +94,10 @@ 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){ | ||||||
|  |             if (!empty($data[$item])){ | ||||||
|                 $model->{$item} = $data[$item] ?? null; |                 $model->{$item} = $data[$item] ?? null; | ||||||
|             } |             } | ||||||
|  |         } | ||||||
|  |  | ||||||
|         $model->save(); |         $model->save(); | ||||||
|         $this->renderApi($model->toArray()); |         $this->renderApi($model->toArray()); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user