Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit af6e88d

Browse files
authored
Merge pull request LaravelCollective#671 from repat/6.x
Fix method_exists when model is not string or object (PHP8)
2 parents f337e4f + 06ae76a commit af6e88d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FormBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ protected function getModelValueAttribute($name)
13621362
{
13631363
$key = $this->transformKey($name);
13641364

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

0 commit comments

Comments
 (0)