PHPackages                             fiveam-code/laravel-notion-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. fiveam-code/laravel-notion-api

ActiveLibrary[API Development](/categories/api)

fiveam-code/laravel-notion-api
==============================

Laravel Wrapper for the Notion API

1.3.0(1y ago)435224.4k—4.4%55[9 issues](https://github.com/5am-code/laravel-notion-api/issues)[4 PRs](https://github.com/5am-code/laravel-notion-api/pulls)1MITPHPPHP ^8.0CI passing

Since May 14Pushed 1y ago8 watchersCompare

[ Source](https://github.com/5am-code/laravel-notion-api)[ Packagist](https://packagist.org/packages/fiveam-code/laravel-notion-api)[ Docs](https://github.com/fiveam-code/laravel-notion-api)[ Patreon](https://www.patreon.com/5amcode)[ RSS](/packages/fiveam-code-laravel-notion-api/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (38)Used By (1)

 Notion for Laravel
===================

[](#-notion-for-laravel)

[![Notion For Laravel](https://camo.githubusercontent.com/bb4cbce76a2ee6f7a0a7c8aa90d147a2be999f66c2f57a9cf81854b87a5e1a85/68747470733a2f2f6e6f74696f6e666f726c61726176656c2e636f6d2f696d616765732f6f70656e2d67726170682e706e67)](https://camo.githubusercontent.com/bb4cbce76a2ee6f7a0a7c8aa90d147a2be999f66c2f57a9cf81854b87a5e1a85/68747470733a2f2f6e6f74696f6e666f726c61726176656c2e636f6d2f696d616765732f6f70656e2d67726170682e706e67)[![Run tests](https://github.com/5am-code/laravel-notion-api/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/5am-code/laravel-notion-api/actions/workflows/main.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/019a395e94e38e10859ae13ff92bc7b2412b90b2d6c82612d58c14316bedca9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66697665616d2d636f64652f6c61726176656c2d6e6f74696f6e2d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fiveam-code/laravel-notion-api)[![Total Downloads](https://camo.githubusercontent.com/50cd75c3abf576ec8b133199cf8c0ad92d1acb2e8028857993c83b048a039078/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66697665616d2d636f64652f6c61726176656c2d6e6f74696f6e2d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/fiveam-code/laravel-notion-api)

This package provides a simple and crisp way to access the Notion API endpoints, query data and update existing entries. Documentation
=============

[](#documentation)

For a extensive documentation, more context and usage examples, head over to the official documentation at [notionforlaravel.com](https://notionforlaravel.com).

Quick Start Guide
=================

[](#quick-start-guide)

All examples refer to our test database, which you can find [here](https://dianawebdev.notion.site/8284f3ff77e24d4a939d19459e4d6bdc?v=bc3a9ce8cdb84d3faefc9ae490136ac2).

Installation
------------

[](#installation)

The package is compatible with Laravel 8, 9 and 10. The minimum PHP requirement is 8.0.

1. Install the package via composer:

    ```
    composer require fiveam-code/laravel-notion-api
    ```
2. Get your Notion API access token like explained in [their documentation](https://developers.notion.com/). It's also important to grant access to the integration within your Notion pages, which is described in the developer documentation at Notion as well.
3. Add a new line to your applications `.env` file:

    ```
    NOTION_API_TOKEN="$YOUR_ACCESS_TOKEN"
    ```
4. You're ready to go! You can now access Notion endpoints through the `Notion` facade:

    ```
    use \Notion;

    Notion::databases()->find("8284f3ff77e24d4a939d19459e4d6bdc");
    ```

    That's it.

For detailed usage information and a list of available endpoints see (the docs).

Examples
--------

[](#examples)

### Fetch a Notion Database

[](#fetch-a-notion-database)

The `databases()->find()` method returns a `FiveamCode\LaravelNotionApi\Entities\Database` object, which contains all the information about the database, including its properties and the possible values for each property.

```
use \Notion;

Notion::databases()
        ->find("8284f3ff77e24d4a939d19459e4d6bdc");
```

### Fetch a Notion Page

[](#fetch-a-notion-page)

The `pages()->find()` method returns a `FiveamCode\LaravelNotionApi\Entities\Page` object, which contains all the information about the page, including its properties and the possible values for each property.

```
Notion::pages()
        ->find("e7e5e47d-23ca-463b-9750-eb07ca7115e4");
```

### Search

[](#search)

The `search()` endpoint returns a collection of pages that match the search query. The scope of the search is limited to the workspace that the integration is installed in and the pages that are shared with the integration.

```
Notion::search("Search term")
        ->query()
        ->asCollection();
```

### Query Database

[](#query-database)

The `database()` endpoint allows you to query a specific database and returns a collection of pages (= database entries). You can filter and sort the results and limit the number of returned entries. For detailed information about the available filters and sorts, please refer to the [documentation](https://developers.notion.com/reference/post-database-query).

```
use FiveamCode\LaravelNotionApi\Query\Filters\Filter;
use FiveamCode\LaravelNotionApi\Query\Filters\Operators;

$nameFilter = Filter::textFilter('Name', Operators::EQUALS, 'Ada Lovelace');

\Notion::database("8284f3ff77e24d4a939d19459e4d6bdc")
    ->filterBy($nameFilter)
    ->limit(5)
    ->query()
    ->asCollection();
```

Compound filters for AND or OR queries are also available:

```
use Illuminate\Support\Collection;
use FiveamCode\LaravelNotionApi\Query\Filters\Filter;
use FiveamCode\LaravelNotionApi\Query\Filters\FilterBag;
use FiveamCode\LaravelNotionApi\Query\Filters\Operators;
use FiveamCode\LaravelNotionApi\Query\Sorting;

# Give me all entries that are
# (KnownFor == UNIVAC || KnownFor == ENIAC)
# and sort them by name ascending

$filterBag = new FilterBag(Operators::AND);

$filterBag->addFilter(
    Filter::rawFilter("Known for", [
        "multi_select" => [Operators::CONTAINS => "UNIVAC"],
    ])
);

$filterBag->addFilter(
    Filter::rawFilter("Known for", [
        "multi_select" => [Operators::CONTAINS => "ENIAC"],
    ])
);

\Notion::database("8284f3ff77e24d4a939d19459e4d6bdc")
    ->filterBy($filterBag)
    ->sortBy(Sorting::propertySort('Name', 'ascending'))
    ->limit(5)
    ->query()
    ->asCollection();
```

### Tests

[](#tests)

You can find even more usage examples by checking out the package tests in the `/tests` directory. We are using [Pest](https://pestphp.com/) for out tests and are currently in the process of switching all existing PHPUnit tests to Pest.

If you want to run the tests in your CLI:

```
vendor/bin/pest tests
```

Support
=======

[](#support)

Supported by Tinkerwell
-----------------------

[](#supported-by-tinkerwell)

[![Tinkerwell](https://camo.githubusercontent.com/335c1f73ad4098980198202a90f072461dc776fb6f0e4990b502ebb13b79f402/68747470733a2f2f74696e6b657277656c6c2e6170702f696d616765732f74696e6b657277656c6c5f6c6f676f2e706e67) ](https://tinkerwell.app/)The development of this package is supported by [Tinkerwell](https://tinkerwell.app/).

Contributing
============

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
========

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
=======

[](#credits)

- [Diana Scharf](https://github.com/mechelon)
- [Johannes Güntner](https://github.com/johguentner)

[![](https://camo.githubusercontent.com/022ef606a817d8e862d4bd3046fb98e044e9ec8303e6ed3d075da4034c0179b5/68747470733a2f2f35616d636f2e64652f696d616765732f35616d2e706e67)](https://camo.githubusercontent.com/022ef606a817d8e862d4bd3046fb98e044e9ec8303e6ed3d075da4034c0179b5/68747470733a2f2f35616d636f2e64652f696d616765732f35616d2e706e67)

License
=======

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance44

Moderate activity, may be stable

Popularity56

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 53.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~86 days

Recently: every ~173 days

Total

17

Last Release

440d ago

Major Versions

v0.8.1 → v1.0.02023-04-10

PHP version history (2 changes)v0.1.0-alphaPHP ^7.4|^8.0

v1.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc85ff6fa32b7e9b21cfc95ea4deb433757b90c32c4e1a6e957ece8147758ea7?d=identicon)[5amcode](/maintainers/5amcode)

---

Top Contributors

[![johguentner](https://avatars.githubusercontent.com/u/3506359?v=4)](https://github.com/johguentner "johguentner (241 commits)")[![mechelon](https://avatars.githubusercontent.com/u/26432041?v=4)](https://github.com/mechelon "mechelon (186 commits)")[![danielh-official](https://avatars.githubusercontent.com/u/49914607?v=4)](https://github.com/danielh-official "danielh-official (5 commits)")[![Gummibeer](https://avatars.githubusercontent.com/u/6187884?v=4)](https://github.com/Gummibeer "Gummibeer (5 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (5 commits)")[![sschlein](https://avatars.githubusercontent.com/u/2911113?v=4)](https://github.com/sschlein "sschlein (1 commits)")[![blessingefkt](https://avatars.githubusercontent.com/u/887992?v=4)](https://github.com/blessingefkt "blessingefkt (1 commits)")[![treonde-user](https://avatars.githubusercontent.com/u/70837064?v=4)](https://github.com/treonde-user "treonde-user (1 commits)")[![farez](https://avatars.githubusercontent.com/u/39633?v=4)](https://github.com/farez "farez (1 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (1 commits)")[![osbre](https://avatars.githubusercontent.com/u/23292709?v=4)](https://github.com/osbre "osbre (1 commits)")[![richardhj](https://avatars.githubusercontent.com/u/1284725?v=4)](https://github.com/richardhj "richardhj (1 commits)")

---

Tags

apieffortless-notion-integrationslaravelnotionnotion-apinotion-integrationnotion-sdkphpphp-notionlaravelApi Wrappernotionfiveam-codelaravel-notion-apinotion-api

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/fiveam-code-laravel-notion-api/health.svg)

```
[![Health](https://phpackages.com/badges/fiveam-code-laravel-notion-api/health.svg)](https://phpackages.com/packages/fiveam-code-laravel-notion-api)
```

###  Alternatives

[irazasyed/telegram-bot-sdk

The Unofficial Telegram Bot API PHP SDK

3.3k4.5M84](/packages/irazasyed-telegram-bot-sdk)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[marcreichel/igdb-laravel

A Laravel wrapper for version 4 of the IGDB API (Apicalypse) including webhook handling

115146.6k1](/packages/marcreichel-igdb-laravel)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[dcblogdev/laravel-xero

A Laravel Xero package

53129.1k1](/packages/dcblogdev-laravel-xero)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
