This commit is contained in:
2023-07-30 02:15:19 +08:00
parent 58b939f72e
commit 277a919436
28 changed files with 807 additions and 99 deletions

View File

@@ -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 '';