$this->validate($request, [
'name' => 'required|string|max:255',
'description' => 'string|max:1000',
- 'image' => $this->getImageValidationRules(),
+ 'image' => 'nullable|' . $this->getImageValidationRules(),
]);
$bookIds = explode(',', $request->get('books', ''));
$shelf = $this->bookshelfRepo->create($request->all(), $bookIds);
- $this->bookshelfRepo->updateCoverImage($shelf);
+ $this->bookshelfRepo->updateCoverImage($shelf, $request->file('image', null));
Activity::add($shelf, 'bookshelf_create');
return redirect($shelf->getUrl());
public function show(string $slug)
{
$shelf = $this->bookshelfRepo->getBySlug($slug);
+ $view = setting()->getForCurrentUser('books_view_type', config('app.views.books'));
$this->checkOwnablePermission('book-view', $shelf);
Views::add($shelf);
$this->setPageTitle($shelf->getShortName());
return view('shelves.show', [
'shelf' => $shelf,
+ 'view' => $view,
'activity' => Activity::entityActivity($shelf, 20, 1)
]);
}
$this->validate($request, [
'name' => 'required|string|max:255',
'description' => 'string|max:1000',
- 'image' => $this->imageRepo->getImageValidationRules(),
+ 'image' => 'nullable|' . $this->getImageValidationRules(),
]);