BookStack\Repos\EntityRepo::getRecentlyCreatedChapters PHP Method

getRecentlyCreatedChapters() public method

Get the latest chapters added to the system.
public getRecentlyCreatedChapters ( integer $count = 20, integer $page, boolean $additionalQuery = false )
$count integer
$page integer
$additionalQuery boolean
    public function getRecentlyCreatedChapters($count = 20, $page = 0, $additionalQuery = false)
    {
        $query = $this->permissionService->enforceChapterRestrictions($this->chapter)->orderBy('created_at', 'desc');
        if ($additionalQuery !== false && is_callable($additionalQuery)) {
            $additionalQuery($query);
        }
        return $query->skip($page * $count)->take($count)->get();
    }