andrew1601/laravel-arbor
最新稳定版本:1.0.0
Composer 安装命令:
composer require andrew1601/laravel-arbor
包简介
A minimal package to quickly use the Arbor Education API in a Laravel project
README 文档
README
A minimal package to enable quick integration of the Arbor Education API in a Laravel application. Currently it only supports the GraphQL API.
Installation
Install laravel-arbor with composer
composer require andrew1601/laravel-arbor
Add your Arbor application's credentials to your .env file
ARBOR_URL=https://api-sandbox2.uk.arbor.sc
ARBOR_APP_USERNAME=
ARBOR_APP_PASSWORD=
Usage/Examples
You can use the ArborGraphQL facade to query with GraphQL. The facade is automatically registered for you when you install the package.
This facade returns the instance of Softonic\GraphQL\Client that was registered into your Laravel application and is pre-configured to query the GraphQL endpoint of the Arbor site entered in the ARBOR_URL variable of your .env file.
$query = <<<GQL query { Student(currentlyEnrolled: true) { id displayName } } GQL; $response = ArborGraphQL::query($query); if ($response->hasErrors()) { // handle errors here } else { $data = $response->getData(); }
For more information on performing queries, see the documentation for Softonic's GraphQL Client.
For information about the queries you can perform, see the documentation for Arbor Education's GraphQL API
Authors
Acknowledgements
License
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-18