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

v1.0.0(3mo ago)01.9k↓80%1MITPHPCI passing

Since Mar 27Pushed 3w 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 today

READMEChangelog (1)Dependencies (7)Versions (2)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

26

—

LowBetter than 41% of packages

Maintenance62

Regular maintenance activity

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity12

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

98d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1053395?v=4)[Ed Grosvenor](/maintainers/edgrosvenor)[@edgrosvenor](https://github.com/edgrosvenor)

---

Top Contributors

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

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### 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

[saloonphp/laravel-plugin

The official Laravel plugin for Saloon

807.1M201](/packages/saloonphp-laravel-plugin)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1123.7k](/packages/codebar-ag-laravel-docuware)

PHPackages © 2026

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