diff --git a/app/Book.php b/app/Book.php index a489acf8b..b4cafd65b 100644 --- a/app/Book.php +++ b/app/Book.php @@ -18,7 +18,7 @@ class Book extends Entity return baseUrl('/books/' . urlencode($this->slug)); } -public function getBookCover($size = 120) + public function getBookCover($size = 120) { $default = baseUrl('/default.png'); $image = $this->image; @@ -32,7 +32,7 @@ public function getBookCover($size = 120) return $cover; } -public function cover() + public function cover() { return $this->belongsTo(Image::class, 'image'); } diff --git a/resources/views/books/form.blade.php b/resources/views/books/form.blade.php index 4cc5d2ff3..34f5fd842 100644 --- a/resources/views/books/form.blade.php +++ b/resources/views/books/form.blade.php @@ -10,20 +10,20 @@ @include('form/textarea', ['name' => 'description'])
{{ trans('common.cover_image_description') }}
+ +{{ trans('common.cover_image_description') }}
- @include('components.image-picker', [ - 'resizeHeight' => '192', - 'resizeWidth' => '120', - 'showRemove' => true, - 'defaultImage' => baseUrl('/default.png'), - 'currentImage' => @isset($model) ? $model->getBookCover(80) : baseUrl('/default.png') , - 'currentId' => @isset($model) ? $model->image : 0, - 'name' => 'image', - 'imageClass' => 'avatar cover' - ]) -