All Projects → cybercog → laravel-youtrack-sdk

cybercog / laravel-youtrack-sdk

Licence: MIT license
Laravel wrapper for the YouTrack PHP Software Development Kit provides set of tools to interact with JetBrains YouTrack.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-youtrack-sdk

tiket
TIKET is a ticketing/helpdesk system to support and help you deal with issues/incidents in your organization or from customers.
Stars: ✭ 59 (+247.06%)
Mutual labels:  issue-tracker, bugtracker
yii2-google-analytics
Google Analytics Universal tracking widget.
Stars: ✭ 14 (-17.65%)
Mutual labels:  cog, cybercog
youtrack-cli
Command Line Tool for interacting with youtrack
Stars: ✭ 14 (-17.65%)
Mutual labels:  jetbrains, youtrack
youtrack
YouTrack Python 3 Client Library
Stars: ✭ 22 (+29.41%)
Mutual labels:  jetbrains, youtrack
gort
Gort is a chatbot framework designed from the ground up for chatops.
Stars: ✭ 381 (+2141.18%)
Mutual labels:  cog
Intellij Csv Validator
CSV validator, highlighter and formatter plugin for JetBrains Intellij IDEA, PyCharm, WebStorm, ...
Stars: ✭ 198 (+1064.71%)
Mutual labels:  jetbrains
Darcula
A Vim color scheme reproduction of the official JetBrains IDE Darcula theme
Stars: ✭ 158 (+829.41%)
Mutual labels:  jetbrains
cog-helm
A Helm chart to deploy Cog on Kubernetes
Stars: ✭ 17 (+0%)
Mutual labels:  cog
Idea Php Generics Plugin
Support generics types in PhpStorm via psalm / phpstan docblock
Stars: ✭ 146 (+758.82%)
Mutual labels:  jetbrains
flare-cogs
Various cogs written for Red-DiscordBot
Stars: ✭ 71 (+317.65%)
Mutual labels:  cog
cogy
Cog commands from your Rails app
Stars: ✭ 20 (+17.65%)
Mutual labels:  cog
Resharper Fsharp
F# support in JetBrains Rider
Stars: ✭ 216 (+1170.59%)
Mutual labels:  jetbrains
cogviewer
Simple Cloud Optimized GeoTIFF viewer.
Stars: ✭ 21 (+23.53%)
Mutual labels:  cog
Jetbrains Plugin Graph Database Support
Graph Databases support for JetBrains family IDEs.
Stars: ✭ 169 (+894.12%)
Mutual labels:  jetbrains
resharper-xunit-templates
ReSharper Live Templates for xUnit.net
Stars: ✭ 18 (+5.88%)
Mutual labels:  jetbrains
Intellij Platform Solarized
Solarized UI and editor themes for IntelliJ IDEA, CLion, Rider, PyCharm, RubyMine, PhpStorm, WebStorm, Android Studio, DataGrip and GoLand
Stars: ✭ 148 (+770.59%)
Mutual labels:  jetbrains
Fixator10-Cogs
Cogs for Red-DiscordBot. Including port of Stevy's V2 leveler.
Stars: ✭ 66 (+288.24%)
Mutual labels:  cog
decoupage-administratif
Données concernant le découpage administratif français, au format JSON
Stars: ✭ 40 (+135.29%)
Mutual labels:  cog
Jetbrains Discord Integration
Discord rich presence integration for all JetBrains IDEs
Stars: ✭ 247 (+1352.94%)
Mutual labels:  jetbrains
FluffyCogs
Cogs for Red V3
Stars: ✭ 23 (+35.29%)
Mutual labels:  cog

Laravel YouTrack SDK

cog-laravel-youtrack-sdk

Build Status StyleCI Code Climate Releases License

Introduction

Laravel wrapper for the PHP YouTrack SDK library provides set of tools to interact with JetBrains YouTrack Issue Tracking and Project Management software.

Contents

Features

Requirements

  • YouTrack >= 3.0 with REST-API enabled (always enabled, by default)
  • PHP >= 7.1
  • Guzzle HTTP Client >= 6.2
  • Laravel >= 5.1.20

Installation

The preferred method is via composer. Follow the installation instructions if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

composer require cybercog/laravel-youtrack-sdk

Configuration

Laravel YouTrack SDK designed to work with default config, but it always could be modified. First of all publish it:

php artisan vendor:publish --tag="youtrack-config"

This will create a config/youtrack.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

YouTrack URL

YouTrack instance location could be defined in .env file:

YOUTRACK_BASE_URI=https://youtrack.custom.domain

Authorization methods

Starting with YouTrack 2017.1 release authorization based on permanent tokens is recommended as the main approach for the authorization in your REST API calls.

By default Token authorization will be used. You could redefine it in .env file:

Token authorization

YOUTRACK_AUTH=token
YOUTRACK_TOKEN=your-permanents-token

Cookie authorization

YOUTRACK_AUTH=cookie
YOUTRACK_USERNAME=username
YOUTRACK_PASSWORD=secret

Usage

Initialize API client

$youtrack = app(\Cog\Contracts\YouTrack\Rest\Client\Client::class);

As result instantiated \Cog\YouTrack\Rest\Client\YouTrackClient class should be returned.

API requests

HTTP request

$method = 'POST'; // GET, POST, PUT, DELETE, PATCH or any custom ones
$response = $youtrack->request($method, '/issue', [
    'project' => 'TEST',
    'summary' => 'New test issue',
    'description' => 'Test description',
]);

You can customize requests created and transferred by a client using request options. Request options control various aspects of a request including, headers, query string parameters, timeout settings, the body of a request, and much more.

$options = [
    'debug' => true,
    'sink' => '/path/to/dump/file',
];
$response = $youtrack->request('POST', '/issue', [
    'project' => 'TEST',
    'summary' => 'New test issue',
    'description' => 'Test description',
], $options);

HTTP GET request

$response = $youtrack->get('/issue/TEST-1');

HTTP POST request

$response = $youtrack->post('/issue', [
    'project' => 'TEST',
    'summary' => 'New test issue',
    'description' => 'Test description',
]);

HTTP PUT request

$response = $youtrack->put('/issue/TEST-1', [
    'summary' => 'Updated summary',
    'description' => 'Updated description',
]);

HTTP DELETE request

$response = $youtrack->delete('/issue/TEST-1');

API responses

Each successful request to the API returns instance of \Cog\Contracts\YouTrack\Rest\Response\Response contract. By default it's \Cog\YouTrack\Rest\Response\YouTrackResponse class.

Get PSR HTTP response

PSR HTTP response could be accessed by calling httpResponse method on API Response.

$youtrackResponse = $youtrack->get('/issue/TEST-1');
$psrResponse = $youtrackResponse->httpResponse();

Get response Cookie

Returns Set-Cookie headers as string from the HTTP response.

$apiResponse = $youtrack->get('/issue/TEST-1');
$cookieString = $apiResponse->cookie();

Get response Location

Returns Location header from the HTTP response.

$apiResponse = $youtrack->get('/issue/TEST-1');
$location = $apiResponse->location();

Transform response to array

$apiResponse = $youtrack->get('/issue/TEST-1');
$location = $apiResponse->toArray();

Get HTTP response status code

$apiResponse = $youtrack->get('/issue/TEST-1');
$location = $apiResponse->statusCode();

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Testing

Run the tests with:

vendor/bin/phpunit

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributors

@antonkomarev
Anton Komarev
sergiy-petrov

Laravel YouTrack SDK contributors list

Alternatives

Alternatives not found.

Feel free to add more alternatives as Pull Request.

License

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research best solutions in product & software development is our passion.

CyberCog

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].