]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Models/Book.php
Input WYSIWYG: Updated API to show/accept html descriptions
[bookstack] / app / Entities / Models / Book.php
index faae276a5c08bd8389768b3cf9d6fa04d82bc6ca..14cb790c5c509c9283713aaa6a1b69fce4f22b8b 100644 (file)
@@ -15,7 +15,7 @@ use Illuminate\Support\Collection;
  *
  * @property string                                   $description
  * @property int                                      $image_id
- * @property ?int                                     $default_template
+ * @property ?int                                     $default_template_id
  * @property Image|null                               $cover
  * @property \Illuminate\Database\Eloquent\Collection $chapters
  * @property \Illuminate\Database\Eloquent\Collection $pages
@@ -26,11 +26,12 @@ use Illuminate\Support\Collection;
 class Book extends Entity implements HasCoverImage
 {
     use HasFactory;
+    use HasHtmlDescription;
 
-    public $searchFactor = 1.2;
+    public float $searchFactor = 1.2;
 
-    protected $fillable = ['name', 'description'];
-    protected $hidden = ['pivot', 'image_id', 'deleted_at'];
+    protected $fillable = ['name'];
+    protected $hidden = ['pivot', 'image_id', 'deleted_at', 'description_html'];
 
     /**
      * Get the url for this book.
@@ -78,7 +79,7 @@ class Book extends Entity implements HasCoverImage
      */
     public function defaultTemplate(): BelongsTo
     {
-        return $this->belongsTo(Page::class, 'default_template');
+        return $this->belongsTo(Page::class, 'default_template_id');
     }
 
     /**