From 909c80e7018656823fa555bcc1d09755691b2e9a Mon Sep 17 00:00:00 2001 From: Arman Arif Date: Sun, 1 Jan 2023 13:39:21 +0600 Subject: [PATCH] A fix to issue #174 --- src/Traits/RendersContent.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Traits/RendersContent.php b/src/Traits/RendersContent.php index c60c6f3d..19c5c298 100644 --- a/src/Traits/RendersContent.php +++ b/src/Traits/RendersContent.php @@ -8,13 +8,21 @@ trait RendersContent { - protected $contentColumn = 'content'; public function render(string $column = null): string { - $column = $column ?: $this->contentColumn; + $column = $column ?: $this->getContentColumn(); $renderer = app(ContentRenderer::class); $content = $this->$column; return $renderer->render(is_string($content) ? $content : ''); } + + protected function getContentColumn() + { + if (property_exists($this, 'contentColumn')) { + return $this->contentColumn; + } + + return 'content'; + } }