PHPackages                             artisan-build/packagist - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. artisan-build/packagist

ActiveLibrary[API Development](/categories/api)

artisan-build/packagist
=======================

Laravel wrapper for the Packagist API

01.2k↓50%1PHPCI passing

Since Oct 13Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/artisan-build/packagist)[ Packagist](https://packagist.org/packages/artisan-build/packagist)[ RSS](/packages/artisan-build-packagist/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (1)

Packagist
=========

[](#packagist)

Laravel wrapper for the Packagist API

Warning

This package is currently under active development, and we have not yet released a major version. Once a 0.\* version has been tagged, we strongly recommend locking your application to a specific working version because we might make breaking changes even in patch releases until we've tagged 1.0.

Installation
------------

[](#installation)

`composer require artisan-build/packagist`

Configuration
-------------

[](#configuration)

Log into your account at Packagist and copy the following values into your .env file:

```
PACKAGIST_USERNAME=
PACKAGIST_MAIN_TOKEN=
PACKAGIST_SAFE_TOKEN=
```

Usage
-----

[](#usage)

This package uses [Saloon](https://docs.saloon.dev) to wrap almost all the API endpoints offered by Packagist.

We do not have any tests set up yet for this package, and we are considering using the Laravel Saloon package to refactor this to take advantage of a facade to facilitate testing within apps that consume this package.

Even if we do this, there is little chance that we will significantly change the existing implementation.

### The Connector

[](#the-connector)

There is one connector that is used for every request. It is called `PackagistConnector`.

```
use ArtisanBuild\Packagist\Connectors\PackagistConnector;

$connector = new PackagistConnector();
```

### The Requests

[](#the-requests)

See the [Packagist API Docs](https://packagist.org/apidoc) for details on the constructor arguments.

```
// List Packages
use ArtisanBuild\Packagist\Requests\ListPackagesRequest;
$request = new ListPackagesRequest(vendor: null, type: null, fields: [])
$connector->send($request)
```

```
// List Popular Packages
use ArtisanBuild\Packagist\Requests\ListPopularPackagesRequest;
$request = new ListPopularPackagesRequest(page: 1, per_page: 100)
$connector->send($request)
```

```
// Search Packages
use ArtisanBuild\Packagist\Requests\SearchRequest;
$request = new SearchRequest(q: 'Laravel', page: 1, per_page: 25, tags: null, type: null);
$connector->send($request)
```

```
// Get Package Info
use ArtisanBuild\Packagist\Requests\PackageInfoRequest;
$request = new PackageInfoRequest(vendor: 'artisan-build', package: 'packagist');
$connector->send($request)
```

```
// Get Package Stats
use ArtisanBuild\Packagist\Requests\PackageStatsRequest;
$request = new PackageStatsRequest(vendor: 'artisan-build', package: 'packagist');
$connector->send($request)
```

```
use ArtisanBuild\Packagist\Requests\PackageMetadataRequest;
$request = new PackageMetadataRequest(vendor: 'artisan-build', package: 'packagist', dev: false);
$connector->send($request)
```

A quick note about the metadata request above... The `dev` argument does not seem to work. I'm not entirely sure what this is actually supposed to return, but it's in the docs. However, when I set it to true and append `-dev` to the package name as described in the Packagist docs, I get an error. It's not something we need ourselves, so I'm not going to worry too much about it, but if anyone knows how to fix it and can explain what it's useful for, we'd love to hear from you.

```
// Create Package
use ArtisanBuild\Packagist\Requests\CreatePackageRequest;

$request = new CreatePackageRequest(
    repository: 'https://github.com/artisan-build/packagist',
    username: null,
    token: null, // main token
);
```

```
// Edit a Package URL
use ArtisanBuild\Packagist\Requests\CreatePackageRequest;

$request = new EditPackageRequest(
    vendor: 'artisan-build',
    package: 'packagist'
    repository: 'https://github.com/artisan-build/packagist-laravel',
    username: null,
    token: null, // main token
);
```

```
// Update a package
use ArtisanBuild\Packagist\Requests\UpdatePackageRequest;

$request = new UpdatePackageRequest(
    repository: 'https://github.com/artisan-build/packagist',
    username: null,
    token: null, // safe token if set, main token if not
);
```

Memberware
----------

[](#memberware)

This package is part of our internal toolkit and is optimized for our own purposes. We do not accept issues or PRs in this repository.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance45

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/55eed7400c452edf7e7adfa4f1c6676b65b5ce1867fff6bddcb80b1bb45360af?d=identicon)[edgrosvenor](/maintainers/edgrosvenor)

---

Top Contributors

[![edgrosvenor](https://avatars.githubusercontent.com/u/1053395?v=4)](https://github.com/edgrosvenor "edgrosvenor (9 commits)")

### Embed Badge

![Health badge](/badges/artisan-build-packagist/health.svg)

```
[![Health](https://phpackages.com/badges/artisan-build-packagist/health.svg)](https://phpackages.com/packages/artisan-build-packagist)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
