]> BookStack Code Mirror - bookstack/blobdiff - app/Book.php
Merge pull request #3 from OsmosysSoftware/revert-1-issue-181
[bookstack] / app / Book.php
index a489acf8b38a7f11149cf153dc07bfae4aedcd88..06c00945d43c4dbdea946c21769ffef7a626888f 100644 (file)
@@ -3,7 +3,7 @@
 class Book extends Entity
 {
 
-    protected $fillable = ['name', 'description', 'image'];
+    protected $fillable = ['name', 'description'];
 
     /**
      * Get the url for this book.
@@ -18,24 +18,6 @@ class Book extends Entity
         return baseUrl('/books/' . urlencode($this->slug));
     }
 
-public function getBookCover($size = 120)
-    {
-        $default = baseUrl('/default.png');
-        $image = $this->image;
-        if ($image === 0 || $image === '0' || $image === null) 
-            return $default;
-        try {
-            $cover = $this->cover ? baseUrl($this->cover->getThumb(120, 192, false)) : $default;
-        } catch (\Exception $err) {
-            $cover = $default;
-        }
-        return $cover;
-    }
-
-public function cover()
-    {
-        return $this->belongsTo(Image::class, 'image');
-    }
     /*
      * Get the edit url for this book.
      * @return string