$this->checkPermission('book-update');
$book = $this->bookRepo->getBySlug($bookSlug);
$bookChildren = $this->bookRepo->getChildren($book);
- $books = $this->bookRepo->getAll();
+ $books = $this->bookRepo->getAll(false);
$this->setPageTitle('Sort Book ' . $book->getShortName());
return view('books/sort', ['book' => $book, 'current' => $book, 'books' => $books, 'bookChildren' => $bookChildren]);
}
/**
* BookRepo constructor.
- * @param Book $book
- * @param PageRepo $pageRepo
+ * @param Book $book
+ * @param PageRepo $pageRepo
* @param ChapterRepo $chapterRepo
*/
public function __construct(Book $book, PageRepo $pageRepo, ChapterRepo $chapterRepo)
*/
public function getAll($count = 10)
{
- return $this->book->orderBy('name', 'asc')->take($count)->get();
+ $bookQuery = $this->book->orderBy('name', 'asc');
+ if (!$count) return $bookQuery->get();
+ return $bookQuery->take($count)->get();
}
/**
}
/**
- * @param string $slug
+ * @param string $slug
* @param bool|false $currentId
* @return bool
*/
/**
* Provides a suitable slug for the given book name.
* Ensures the returned slug is unique in the system.
- * @param string $name
+ * @param string $name
* @param bool|false $currentId
* @return string
*/