fix: Passing record to table column view (#18063)

This commit is contained in:
Dan Harrin
2025-10-03 22:27:51 +01:00
committed by GitHub
parent e70a0f90e6
commit 2a474b075a
@@ -146,15 +146,15 @@ abstract class ViewComponent extends Component implements Htmlable
public function render(): View
{
return $this->viewInstance ??= view(
$this->getView(),
[
'attributes' => new ComponentAttributeBag,
...$this->extractPublicMethods(),
...(isset($this->viewIdentifier) ? [$this->viewIdentifier => $this] : []),
...$this->getExtraViewData(),
...$this->getViewData(),
],
);
$this->viewInstance ??= view($this->getView(), [
...$this->extractPublicMethods(),
...(isset($this->viewIdentifier) ? [$this->viewIdentifier => $this] : []),
]);
return $this->viewInstance->with([
'attributes' => new ComponentAttributeBag,
...$this->getExtraViewData(),
...$this->getViewData(),
]);
}
}