Skip to content

Commit

Permalink
Eliminate double call of the transformKey method
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
Kolpikov authored and crynobone committed Oct 29, 2019
1 parent 3a921b8 commit e4d3e91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,13 @@ protected function request(string $name)
*/
protected function getModelValueAttribute(string $name)
{
$key = $this->transformKey($name);

if (\method_exists($this->model, 'getFormValue')) {
return $this->model->getFormValue($this->transformKey($name));
return $this->model->getFormValue($key);
}

return \data_get($this->model, $this->transformKey($name));
return \data_get($this->model, $key);
}

/**
Expand Down

0 comments on commit e4d3e91

Please sign in to comment.