Skip to content

Commit

Permalink
Fix method_exists when model is not string or object
Browse files Browse the repository at this point in the history
  • Loading branch information
repat committed Nov 19, 2020
1 parent f337e4f commit 06ae76a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ protected function getModelValueAttribute($name)
{
$key = $this->transformKey($name);

if (method_exists($this->model, 'getFormValue')) {
if ((is_string($this->model) || is_object($this->model)) && method_exists($this->model, 'getFormValue')) {
return $this->model->getFormValue($key);
}

Expand Down

0 comments on commit 06ae76a

Please sign in to comment.