Skip to content

Commit df4433e

Browse files
authored
modify for v0.3.0-release
change changelog-link modify examples add references/usedBy
1 parent 9c6aaac commit df4433e

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

README.md

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ Head over to the [Documentation](https://5amco.de/docs) of this package.
3636

3737
### 🔥 Code Examples to jumpstart your Notion API Project
3838

39-
#### Basic Setup
40-
39+
#### Basic Setup (+ example)
4140
```php
42-
use FiveamCode\LaravelNotionApi\Notion;
41+
use FiveamCode\LaravelNotionApi\Notion;
42+
43+
# Access through Facade (token has to be set in .env)
44+
\Notion::databases()->find($databaseId);
4345

44-
// Setup basic API connection
45-
$notion = new Notion();
46-
$notion->v1();
46+
# Custom instantiation (necessary if you want to access more than one NotionApi integration)
47+
$notion = new Notion($apiToken, $apiVersion); // version-default is 'v1'
48+
$notion->databases()->find($databaseId);
4749
```
4850

4951
#### Fetch Page Information
@@ -52,6 +54,14 @@ $notion->v1();
5254
$notion->pages()->find($yourPageId);
5355
```
5456

57+
#### Search
58+
```php
59+
// Returns a collection pages and databases of your workspace (included in your integration-token)
60+
\Notion::search($searchText)
61+
->query()
62+
->asCollection();
63+
```
64+
5565
#### Query Database
5666

5767
```php
@@ -70,17 +80,15 @@ $filters
7080
$filters
7181
->add(Filter::rawFilter('Tags', ['multi_select' => ['contains' => 'great']]));
7282

73-
$notion
74-
->database($yourDatabaseId)
75-
->filterBy($filters) // filters are optional
76-
->sortBy($sortings) // sorts are optional
77-
->limit(5) // limit is optional
78-
->query();
83+
\Notion::database($yourDatabaseId)
84+
->filterBy($filters) // filters are optional
85+
->sortBy($sortings) // sorts are optional
86+
->limit(5) // limit is optional
87+
->query()
88+
->asCollection();
7989
```
8090

8191

82-
83-
8492
### Testing
8593

8694
```bash
@@ -89,7 +97,11 @@ vendor/bin/phpunit tests
8997

9098
### Changelog
9199

92-
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
100+
Please see [CHANGELOG](https://5amco.de/docs/0.3.0/changelog) for more information what has changed recently.
101+
102+
## References / UsedBy
103+
104+
- Julien Nahum created [notionforms.io](https://notionforms.io) with [laravel-notion-api](https://github.com/5am-code/laravel-notion-api), which allows you to easily create custom forms, based on your selected database within notion.
93105

94106
## Contributing
95107

0 commit comments

Comments
 (0)