Skip to content

Commit

Permalink
改进模型getRealFieldName方法
Browse files Browse the repository at this point in the history
  • Loading branch information
liu21st committed Sep 28, 2020
1 parent ce2695d commit 57f9b98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/model/concern/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ public function readOnly(array $field)
*/
protected function getRealFieldName(string $name): string
{
return $this->strict ? $name : Str::snake($name);
if ($this->convertNameToCamel || !$this->strict) {
return Str::snake($name);
}

return $name;
}

/**
Expand Down

0 comments on commit 57f9b98

Please sign in to comment.