Skip to content

Commit

Permalink
Merge pull request LaravelCollective#671 from repat/6.x
Browse files Browse the repository at this point in the history
Fix method_exists when model is not string or object (PHP8)
  • Loading branch information
mlantz authored Dec 15, 2020
2 parents f337e4f + 06ae76a commit af6e88d
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 af6e88d

Please sign in to comment.