X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a663fc8aa83f51db45bb0707c463fc80941d6104..refs/pull/432/head:/app/Book.php diff --git a/app/Book.php b/app/Book.php index b4cafd65b..06c00945d 100644 --- a/app/Book.php +++ b/app/Book.php @@ -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