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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle