Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Github Api Laravel Package

knplabs/github-api

Lightweight, well-tested PHP wrapper for GitHub APIs v3 (REST) and v4 (GraphQL). PSR-17/PSR-18 compatible via HTTPlug, with easy setup using Guzzle, Symfony HttpClient, or other PSR clients. Supports framework integrations (Laravel via graham-campbell/github).

View on GitHub
Deep Wiki
Context7

Pull Requests API

Back to the navigation

Additional APIs:

Lets you list pull requests for a given repository, list one pull request in particular along with its discussion, and create a pull-request. Wraps GitHub Pull Request API.

List all pull requests, per repository

List open pull requests

<?php

$openPullRequests = $client->api('pull_request')->all('ezsystems', 'ezpublish', array('state' => 'open'));

The state parameter of the listPullRequests method default to 'open'. The call above is equivalent to:

<?php

$openPullRequests = $client->api('pull_request')->all('ezsystems', 'ezpublish');

$openPullRequests contains an array of open pull-requests for this repository.

List closed pull requests

<?php

$closedPullRequests = $client->api('pull_request')->all('ezsystems', 'ezpublish', array('state' => 'closed'));

$closedPullRequests contains an array of closed pull-requests for this repository.

List one pull request in particular, along with its discussion

<?php

$pullRequest = $client->api('pull_request')->show('ezsystems', 'ezpublish', 15);

The last parameter of this call, Pull Request ID.

The $pullRequest array contains the same elements as every entry in the result of a all() call, plus a "discussion" key, self-explanatory.

Create a pull request

A pull request can either be created by supplying both the Title & Body, OR an Issue ID. Details regarding the content of parameters 3 and 4 of the create. You can create a draft pull request by adding a parameter with key draft and value true.

Populated with Title and Body

Requires authentication.

<?php

$pullRequest = $client->api('pull_request')->create('ezsystems', 'ezpublish', array(
    'base'  => 'master',
    'head'  => 'testbranch',
    'title' => 'My nifty pull request',
    'body'  => 'This pull request contains a bunch of enhancements and bug-fixes, happily shared with you'
));

This returns the details of the pull request.

Populated with Issue ID

Requires authentication. The issue ID is provided instead of title and body.

<?php

$pullRequest = $client->api('pull_request')->create('ezsystems', 'ezpublish', array(
    'base'  => 'master',
    'head'  => 'testbranch',
    'issue' => 15
));

This returns the details of the pull request.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation