elsayed85/notion
Composer 安装命令:
composer require elsayed85/notion
包简介
This is my package Notion
关键字:
README 文档
README
Installation
You can install the package via composer:
composer require elsayed85/notion
You can publish the config file with:
php artisan vendor:publish --provider="Elsayed85\Notion\NotionServiceProvider" --tag="notion-config"
This is the contents of the published config file:
return [ "base" => "https://api.notion.com", 'version' => '2021-05-13' ];
Add Notion Api To your env
in config/services.php
'notion' => [
'client_id' => env('NOTION_CLIENT_ID'),
'client_secret' => env('NOTION_CLIENT_SECRET'),
'token' => env('NOTION_TOKEN')
]
in .env add
# for public
NOTION_CLIENT_ID=
NOTION_CLIENT_SECRET=
# for internal
NOTION_TOKEN=
Usage
$notion = new Elsayed85\Internal\Notion(); $start_cursor = null; $page_size = 20; // https://developers.notion.com/reference/get-databases $notion->databases($start_cursor , $page_size); // https://developers.notion.com/reference/post-database-query $notion->queryDatabase("2f611956-c64b-4588-ab64-2f013ac42527"); // https://developers.notion.com/reference/get-database $notion->database("2f611956-c64b-4588-ab64-2f013ac42527"); // https://developers.notion.com/reference/get-users $notion->users(); // https://developers.notion.com/reference/get-user $notion->user("73e41e87-0ae2-4ef0-bd21-a9d352c07a47"); // https://developers.notion.com/reference/post-search $notion->search("hassan", 'last_edited_time'); // https://developers.notion.com/reference/get-page $notion->page("cdd93f5f-1626-4388-9a02-78779663a3aa") // https://developers.notion.com/reference/post-page $notion->createPage( "2f611956-c64b-4588-ab64-2f013ac42527", "database_id", [ 'Name' => [ 'title' => [ 0 => [ 'text' => [ 'content' => 'Tuscan Kale', ], ], ], ], 'Email' => [ 'email' => "test@gmail.com", ], ], [ 0 => [ 'object' => 'block', 'type' => 'heading_2', 'heading_2' => [ 'text' => [ 0 => [ 'type' => 'text', 'text' => [ 'content' => 'Lacinato kale', ], ], ], ], ], 1 => [ 'object' => 'block', 'type' => 'paragraph', 'paragraph' => [ 'text' => [ 0 => [ 'type' => 'text', 'text' => [ 'content' => 'Lacinato kale is a variety of kale with a long tradition in Italian cuisine, especially that of Tuscany. It is also known as Tuscan kale, Italian kale, dinosaur kale, kale, flat back kale, palm tree kale, or black Tuscan palm.', 'link' => [ 'url' => 'https://en.wikipedia.org/wiki/Lacinato_kale', ], ], ], ], ], ], ] ); // https://developers.notion.com/reference/patch-page $notion->updatePage( "cdd93f5f-1626-4388-9a02-78779663a3aa", [ 'Name' => [ 'title' => [ 0 => [ 'text' => [ 'content' => 'Tuscan Kale', ], ], ], ], 'Email' => [ 'email' => "test@gmail.com", ], ], [ 0 => [ 'object' => 'block', 'type' => 'heading_2', 'heading_2' => [ 'text' => [ 0 => [ 'type' => 'text', 'text' => [ 'content' => 'Lacinato kale', ], ], ], ], ], 1 => [ 'object' => 'block', 'type' => 'paragraph', 'paragraph' => [ 'text' => [ 0 => [ 'type' => 'text', 'text' => [ 'content' => 'Lacinato kale is a variety of kale with a long tradition in Italian cuisine, especially that of Tuscany. It is also known as Tuscan kale, Italian kale, dinosaur kale, kale, flat back kale, palm tree kale, or black Tuscan palm.', 'link' => [ 'url' => 'https://en.wikipedia.org/wiki/Lacinato_kale', ], ], ], ], ], ], ] );
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
elsayed85/notion 适用场景与选型建议
elsayed85/notion 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 05 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「elsayed85」 「notion」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elsayed85/notion 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elsayed85/notion 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elsayed85/notion 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Notion OAuth2 Provider for Laravel Socialite
Package to use Notion API from PHP
Laravel Package for Converting Notion Pages to Web Pages
Laravel Wrapper for the Notion API
Alfabank REST API integration
Convert markdown to Notion blocks.
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-14