pilarik31/laravel-teamwork

Laravel对Teamwork API的封装

dev-master 2020-03-24 00:12 UTC

This package is auto-updated.

Last update: 2024-09-18 02:57:30 UTC


README

在Laravel 5中,您可以通过一个简单、流畅的API轻松访问Teamwork.com数据。

看看您能有多少乐趣吧!

code sample

仍不确定?请查看API速查表,了解您将如何与API交互。

快速入门指南

安装

composer require squarebit/dovetail

如果您不在Laraqve 5.5+上,您必须手动将服务提供者添加到您的app/config.php文件中

/**
 * Custom Service Providers
 */
SquareBit\Dovetail\ServiceProvider::class,

配置API设置

php artisan vendor:publish --provider="SquareBit\Dovetail\ServiceProvider"

您现在可以在config/dovetail.php中设置默认API密钥和Teamwork.com域。

需要密钥?请参阅Teamwork.com文档:获取API密钥

使用方法

让我们获取您的最新账户活动,怎么样?

<?php
$dovetail = new \SquareBit\Dovetail\Dovetail;
    
$allActivity = $dovetail->activity()->all();

想要更改您认证的身份?这也很简单。您可以通过方法程序化设置配置,或者传入一个ApiClient对象

<?php

// Set all at once!
$dovetail = new \SquareBit\Dovetail\Dovetail(
    new \SquareBit\Dovetail\Api\Client('my-api-key', 'https://myDomain.teamwork.com')
);
$allActivity = $dovetail->activity()->all();

// Or with a method...
$dovetail = new \SquareBit\Dovetail\Dovetail;
$dovetail->apiClient->setApiKey('my-new-key');
$dovetail->apiClient->setApiUrl('https://myDomain.teamwork.com');

$allActivity = $dovetail->activity()->all();

完整的API速查表

还想了解更多?请查看完整的API速查表

https://squarebit.io/zschuessler/dovetail/documentation/getting-started/api-request-cheat-sheet

想看官方的快速入门指南?请点击这里

https://squarebit.io/zschuessler/dovetail/documentation/getting-started/quickstart-guide

路线图

以下端点将在2018年2月28日之前添加

  • boards
  • categories
  • calendar events
  • files
  • time tracking

对于商业用户,完整的webhook支持将在2018年3月1日提供。您将能够完全消费和响应Teamwork.com事件 - 哇!您可以在SquareBit.io Dovetail页面上获得无限使用许可。

单元测试

此包有超过75+个单元测试,并且还在增长。如果感兴趣,请参阅SquareBit.io上的商业许可证。

许可证

如果您是商业用户或打算进行商业使用,请购买许可证:Dovetail在SquareBit.io

如果您打算在不进行商业使用的情况下使用此存储库,代码受Creative Commons Attribution NonCommercial (CC-BY-NC)许可。