diff --git a/src/Endpoints/Pages.php b/src/Endpoints/Pages.php index 2452b86..c9b8132 100644 --- a/src/Endpoints/Pages.php +++ b/src/Endpoints/Pages.php @@ -2,9 +2,12 @@ namespace FiveamCode\LaravelNotionApi\Endpoints; +use FiveamCode\LaravelNotionApi\Entities\Collections\EntityCollection; +use FiveamCode\LaravelNotionApi\Entities\Collections\PageCollection; use FiveamCode\LaravelNotionApi\Entities\Page; use FiveamCode\LaravelNotionApi\Exceptions\NotionException; use FiveamCode\LaravelNotionApi\Exceptions\HandlingException; +use FiveamCode\LaravelNotionApi\Notion; /** * Class Pages @@ -58,7 +61,7 @@ public function createInDatabase(string $parentId, Page $page): Page return new Page($response); } - /** + /** * @return Page */ public function createInPage(string $parentId, Page $page): Page @@ -84,7 +87,17 @@ public function createInPage(string $parentId, Page $page): Page return new Page($response); } - + /** + * Return all pages possible. + * + * @return EntityCollection + * @throws HandlingException + * @throws NotionException + */ + public function all(): EntityCollection + { + return $this->notion->search()->onlyPages()->query(); + } /** * @return array