1. Go to this page and download the library: Download blomstra/linear library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
blomstra / linear example snippets
use Linear\Sdk\Organization;
$o = new Organization('your-token-here');
$organization = $o->get();
// $organization is now an instance of Linear\Dto\Organization
$organization->name;
$organization->id;
$organization->urlKey
use Linear\Sdk\Teams;
$t = new Teams('your-token-here');
$team = $t->getOne('team-id-here');
// $team is now an instance of Linear\Dto\Team
use Linear\Sdk\Teams;
$t = new Teams('your-token-here');
$teams = $t->getAll();
// $teams is now an instance of Linear\Dto\Teams
use Linear\Sdk\Projects;
$p = new Projects('your-token-here');
$project = $p->getOne('project-id-here');
// $project is now an instance of Linear\Dto\Project
use Linear\Sdk\Projects;
$p = new Projects('your-token-here');
$projects = $p->getAll();
// $projects is now an instance of Linear\Dto\Projects
use Linear\Sdk\Issues;
$i = new Issues('your-token-here');
$issue = $i->getOne('issue-id-here');
// $issue is now an instance of Linear\Dto\Issue
use Linear\Sdk\Issues;
$i = new Issues('your-token-here');
$issues = $i->getAll();
// $issues is now an instance of Linear\Dto\Issues
use Linear\Sdk\Issues;
use Linear\Dto\Issue;
use Linear\Sdk\Teams;
$t = new Teams('your-token-here');
$team = $t->getAll()->nodes[0];
$i = new Issues('your-token-here');
$title = 'My new issue';
$description = 'This is a description';
$createdIssue = $i->create($title, $description, $team);
// $createdIssue is now an instance of Linear\Dto\Issue
use Linear\Sdk\Issues;
use Linear\Dto\Issue;
$i = new Issues('your-token-here');
$issue = $i->getOne('issue-id-here');
$updatedIssueDto = new Issue($issue->id, 'updated title', 'updated description');
$updatedIssue = $i->update($updatedIssue);
// $updatedIssue is now an instance of Linear\Dto\Issue
use Linear\Sdk\Issues;
$i = new Issues('your-token-here');
$issue = $i->getOne('issue-id-here');
$i->delete($issue); // returns true or false
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.