Download the PHP package jensvandewiel/laravel-notion-api without Composer

On this page you can find all versions of the php package jensvandewiel/laravel-notion-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-notion-api

Laravel Notion API Package

This package provides an elegant and comprehensive interface for interacting with the Notion API within Laravel applications. It allows you to query, create, update, and manage Notion pages, databases, blocks, comments, users, and more, with a fluent and intuitive API.

Note: This package is a fork maintained for stability and bug fixes on-demand. Updates and improvements are applied as needed, and tests are currently not fully correct. For the latest features, consider the original package.

Installation

The package is compatible with Laravel 12+. Support is only provided for Laravel 12 and above. The minimum PHP requirement is 8.0.

  1. Install the package via Composer:

  2. Obtain your Notion API access token by following the instructions in the Notion developer documentation at https://developers.notion.com/reference/authentication.

  3. Add the token to your application's .env file:

  4. Publish the configuration file (optional, for customization):

Configuration

The package uses the NOTION_API_TOKEN environment variable for authentication. You can customize the API version and other settings in the published config file.

Basic Usage

Access Notion endpoints through the Notion facade:

Or use the facade:

Entities

The package provides several entity classes that represent Notion objects:

Each entity provides methods to access and manipulate its properties.

Pages

Retrieving a Page

To retrieve a page by its ID:

This returns a Page entity with all its properties and content.

Creating a Page in a Database

To create a new page in a database:

Creating a Page as a Child of Another Page

Updating a Page

To update an existing page:

Archiving a Page

Moving a Page

Databases

Retrieving a Database

Creating a Database

Updating a Database

Querying a Database

Blocks

Retrieving Block Children

Appending Block Children

Updating a Block

Deleting a Block

Comments

Creating a Comment

Retrieving Comments

Users

Retrieving Users

Retrieving a Specific User

Search

Searching

File Uploads

Creating a File Upload

Sending a File Upload

Completing a File Upload

Property Types

The package supports all Notion property types:

Filtering and Sorting

When querying databases, you can apply filters and sorting:

Error Handling

The package throws NotionException for API errors. Always wrap your calls in try-catch blocks:

Advanced Usage

Working with Rich Text

Rich text is handled automatically for title and text properties. For more complex rich text manipulation, use the RichText entity.

Custom Property Types

For unsupported property types, you can extend the Property class and implement the Modifiable interface.

Batch Operations

For bulk operations, collect multiple requests and execute them in sequence.

Contributing

Contributions are welcome. Please ensure all tests pass and follow the existing code style.

License

This package is open-sourced software licensed under the MIT license.


All versions of laravel-notion-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
guzzlehttp/guzzle Version ^7.0.1
illuminate/support Version ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jensvandewiel/laravel-notion-api contains the following files

Loading the files please wait ...