'int', 'body' => 'json', 'comment_count' => 'int', 'likes_count' => 'int', ]; protected $fillable = [ 'title', 'slug', 'excerpt', 'author_id', 'featured_image', 'editor', 'body', 'post_format', 'comment_count', 'likes_count', 'status', ]; protected $appends = [ 'html_body', ]; public function author() { return $this->belongsTo(Author::class); } public function post_categories() { return $this->hasMany(PostCategory::class); } public function post_category() { return $this->hasOne(PostCategory::class); } public function getHtmlBodyAttribute() { if (! is_empty($this->body)) { return LaravelEditorJs::render($this->body); } return ''; } }