*/
public function index()
{
- $view = setting()->getUser($this->currentUser, 'bookshelves_view_type', config('app.views.bookshelves', 'grid'));
- $sort = setting()->getUser($this->currentUser, 'bookshelves_sort', 'name');
- $order = setting()->getUser($this->currentUser, 'bookshelves_sort_order', 'asc');
+ $view = setting()->getForCurrentUser('bookshelves_view_type', config('app.views.bookshelves', 'grid'));
+ $sort = setting()->getForCurrentUser('bookshelves_sort', 'name');
+ $order = setting()->getForCurrentUser('bookshelves_sort_order', 'asc');
$sortOptions = [
'name' => trans('common.sort_name'),
'created_at' => trans('common.sort_created_at'),
$shelf->books = $this->entityRepo->getBookshelfChildren($shelf);
}
- $recents = $this->signedIn ? $this->entityRepo->getRecentlyViewed('bookshelf', 4, 0) : false;
+ $recents = $this->isSignedIn() ? $this->entityRepo->getRecentlyViewed('bookshelf', 4, 0) : false;
$popular = $this->entityRepo->getPopular('bookshelf', 4, 0);
$new = $this->entityRepo->getRecentlyCreated('bookshelf', 4, 0);
'image' => $this->imageRepo->getImageValidationRules(),
]);
- $shelf = $this->entityRepo->updateFromInput('bookshelf', $shelf, $request->all());
+ $shelf = $this->entityRepo->updateFromInput($shelf, $request->all());
$this->shelfUpdateActions($shelf, $request);
Activity::add($shelf, 'bookshelf_update');
{
$shelf = $this->entityRepo->getEntityBySlug('bookshelf', $slug); /** @var $shelf Bookshelf */
$this->checkOwnablePermission('bookshelf-delete', $shelf);
- Activity::addMessage('bookshelf_delete', 0, $shelf->name);
+ Activity::addMessage('bookshelf_delete', $shelf->name);
if ($shelf->cover) {
$this->imageRepo->destroyImage($shelf->cover);
$this->checkOwnablePermission('restrictions-manage', $shelf);
$this->entityRepo->updateEntityPermissionsFromRequest($request, $shelf);
- session()->flash('success', trans('entities.shelves_permissions_updated'));
+ $this->showSuccessNotification( trans('entities.shelves_permissions_updated'));
return redirect($shelf->getUrl());
}
$this->checkOwnablePermission('restrictions-manage', $shelf);
$updateCount = $this->entityRepo->copyBookshelfPermissions($shelf);
- session()->flash('success', trans('entities.shelves_copy_permission_success', ['count' => $updateCount]));
+ $this->showSuccessNotification( trans('entities.shelves_copy_permission_success', ['count' => $updateCount]));
return redirect($shelf->getUrl());
}