Getting data for a form from a relation (#472)
This commit is contained in:
1 parent
cecb65626c
commit
e1318fcfdd
2 files changed
+15
-2
No files matched your search
@@ -49,7 +49,7 @@ trait FormAccessible
|
||||
unset($keys[0]);
|
||||
$key = implode('.', $keys);
|
||||
|
||||
if ($this->hasFormMutator($key)) {
|
||||
if (method_exists($relatedModel, 'hasFormMutator') && $relatedModel->hasFormMutator($key)) {
|
||||
return $relatedModel->getFormValue($key);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ trait FormAccessible
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasFormMutator($key)
|
||||
public function hasFormMutator($key)
|
||||
{
|
||||
$methods = $this->getReflection()->getMethods(ReflectionMethod::IS_PUBLIC);
|
||||
|
||||
|
||||
Reference in new issue
Block a user