Skip to content

Commit d092a27

Browse files
committed
read getter of AR if attribute not found
1 parent cad3cc2 commit d092a27

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/BaseColumn.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,10 @@ protected function prepareValue($contextParams = [])
253253
$relation = $data->getRelation($this->name, false);
254254
if ($relation !== null) {
255255
$value = $relation->findFor($this->name, $data);
256-
} else {
256+
} elseif ($data->hasAttribute($this->name)) {
257257
$value = $data->getAttribute($this->name);
258+
} else {
259+
$value = $data->{$this->name};
258260
}
259261
} elseif ($data instanceof Model) {
260262
$value = $data->{$this->name};

0 commit comments

Comments
 (0)