定制 42sol/laravel-youtrack-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

42sol/laravel-youtrack-client

Composer 安装命令:

composer require 42sol/laravel-youtrack-client

包简介

YouTrack API client

README 文档

README

Include service provider in your app

Insert library service provider YouTrackClient\Providers\YouTrackClientProvider::class in your config/app.php file:

'providers' => [
    // other service providers
    YouTrackClient\Providers\YouTrackClientProvider::class,
]

Publish packages resources

This will create config/youtrack.php configuration file.

php artisan vendor:publish --provider="YouTrackClient\Providers\YouTrackClientProvider"

Configure

After publishing package resources you can edit configuration in config/youtrack.php file.

To set your YouTrack instance add to .env variables:

YT_BASE_URL=https://youtrack.example.com               # required
# YT_HUB_URL=https://youtrack.example.com/hub/api/rest # optional
YT_TOKEN="youtrack access token"                       # required

Default routing

If needed, use YouTrackClient\YouTrackRoutes::apply(); to make default library routes, e.g.:

/**
 * This will make routes:
 *  - /yt/projects
 *  - /yt/issues
 *  - ...
 */
Route::prefix('/yt')->group(function () {
    YouTrackClient\YouTrackRoutes::apply();
});

Routes:

  • /projects - get all projects
  • /projects/{id} - get detailed project information by id
  • /projects/{id}/issues - get project issues
  • /projects/{id}/timeTrackingSettings - get project time tracking settings
  • /agiles - get all agile board
  • /agiles/{id} - get detailed agile information by id
  • /issues?query=<filter>&offset=0&limit=50 - get issues by filter
  • /issues/{id} - get detailed issue information by id
  • /organizations - get all organizations
  • /users - get all users

Usage

Manually

use YouTrackClient\YouTrackClient;

$client = new YouTrackClient([
    'baseUrl' => 'https://youtrack.example.com/api',
    'hubUrl' => 'https://youtrack.example.com/hub/api/rest', // optional
    'token' => '<youtrack access token>'
]);

$client->getProjects();

With dependency injection:

use YouTrackClient\YouTrackClient;

class YoutrackTestController extends Controller
{
    private YouTrackClient $client;

    // YouTrackClient will be injected here
    public function __construct(YouTrackClient $client)
    {
        $this->client = $client;
    }

    public function getProjects() {
        return $this->client->getProjects();
    }
}

统计信息

  • 总下载量: 54
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固