mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-27 18:19:59 +08:00
Revert "Bookstack grid view."
This commit is contained in:
20
app/Book.php
20
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
|
||||
|
Reference in New Issue
Block a user