Add (v1)
This commit is contained in:
@@ -40,6 +40,7 @@ class Post extends Model
|
||||
'body' => 'json',
|
||||
'comment_count' => 'int',
|
||||
'likes_count' => 'int',
|
||||
'featured' => 'bool',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
@@ -54,10 +55,12 @@ class Post extends Model
|
||||
'comment_count',
|
||||
'likes_count',
|
||||
'status',
|
||||
'featured',
|
||||
'publish_date',
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
'html_body',
|
||||
//'html_body',
|
||||
];
|
||||
|
||||
public function author()
|
||||
@@ -78,7 +81,7 @@ public function post_category()
|
||||
public function getHtmlBodyAttribute()
|
||||
{
|
||||
if (! is_empty($this->body)) {
|
||||
return LaravelEditorJs::render($this->body);
|
||||
return LaravelEditorJs::render(json_encode($this->body));
|
||||
}
|
||||
|
||||
return '';
|
||||
|
||||
Reference in New Issue
Block a user