mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-11-29 18:27:44 +08:00
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:
parent
f07ed0d5c4
commit
897f87edf9
@ -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
|
||||
|
@ -66,4 +66,13 @@ trait CamelCase
|
||||
}
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
public function getFillable()
|
||||
{
|
||||
$fillable = [];
|
||||
foreach (parent::getFillable() as $key) {
|
||||
$fillable[] = $this->keyTransform($key);
|
||||
}
|
||||
return $fillable;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user