Fixed method fill does not works for camel case model. (#2464)

* Fixed  使用CamelCase驼峰,执行模型批量赋值fill方法时如果key是驼峰同时模型$fillable数组内是蛇形,导致无法批量赋值。

* Update CHANGELOG-2.0.md

Co-authored-by: leetaizhu <taizhu.li@winekar.net>
Co-authored-by: 李铭昕 <715557344@qq.com>
This commit is contained in:
leetaizhu 2020-09-08 18:34:42 +08:00 committed by GitHub
parent f07ed0d5c4
commit 897f87edf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,10 @@
- [#2455](https://github.com/hyperf/hyperf/pull/2455) Added method `Socket::getRequest` to retrieve psr7 request from socket for socketio-server.
- [#2459](https://github.com/hyperf/hyperf/pull/2459) Added `ReloadChannelListener` to reload timeout or failed channels automatically for async-queue.
## Fixed
- [#2464](https://github.com/hyperf/hyperf/pull/2464) Fixed method `fill` does not works for camel case model.
# v2.0.10 - 2020-09-07
## Added

View File

@ -66,4 +66,13 @@ trait CamelCase
}
return $attributes;
}
public function getFillable()
{
$fillable = [];
foreach (parent::getFillable() as $key) {
$fillable[] = $this->keyTransform($key);
}
return $fillable;
}
}