Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/Endpoints/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down