Skip to content

Commit

Permalink
Merge pull request #177 from arman-arif/main
Browse files Browse the repository at this point in the history
Debug - fix #174
  • Loading branch information
mauricewijnia committed Jan 3, 2023
2 parents 3efbadd + 909c80e commit 26d1dd2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Traits/RendersContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}

0 comments on commit 26d1dd2

Please sign in to comment.