PHPackages                             php-pico/http-link - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. php-pico/http-link

ActiveLibrary[HTTP &amp; Networking](/categories/http)

php-pico/http-link
==================

A PSR-13 compliant HTTP Hypermedia Link package.

0.1.0(4d ago)01MITPHP ^8.5

Since Jul 7Compare

[ Source](https://github.com/php-pico/http-link)[ Packagist](https://packagist.org/packages/php-pico/http-link)[ RSS](/packages/php-pico-http-link/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

php-pico/http-link
==================

[](#php-picohttp-link)

A PSR-13 compliant HTTP Hypermedia Link package.

Implements [`psr/link`](https://www.php-fig.org/psr/psr-13/): `Link` implements `LinkInterface` and `EvolvableLinkInterface`; `LinkProvider` implements `LinkProviderInterface` and `EvolvableLinkProviderInterface`. Both classes are immutable — every `with*`/`without*` method returns a new instance.

This package only represents links as PHP objects (data + metadata). It does not render them — turning a `Link`/`LinkProvider` into a `Link` HTTP header, HTML `` tag, or HAL/JSON:API payload is out of scope and left to your application or a separate serialization library.

Requirements
------------

[](#requirements)

- PHP ^8.5

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

[](#installation)

```
composer require php-pico/http-link
```

Usage
-----

[](#usage)

### Link

[](#link)

```
use PhpPico\Http\Link\Link;

$link = new Link(
    href: '/api/users/{id}',
    rels: ['next'],
    attributes: ['type' => 'application/json'],
);

$link->getHref();       // '/api/users/{id}'
$link->isTemplated();   // true (href contains '{')
$link->getRels();       // ['next']
$link->getAttributes(); // ['type' => 'application/json']

// Evolvable methods return new instances
$link = $link->withRel('prev');
$link = $link->withoutRel('next');
$link = $link->withAttribute('hreflang', 'en');
$link = $link->withoutAttribute('type');
$link = $link->withHref('/api/users/42');
```

### LinkProvider

[](#linkprovider)

```
use PhpPico\Http\Link\Link;
use PhpPico\Http\Link\LinkProvider;

$provider = new LinkProvider([
    new Link('/api/users', ['self']),
    new Link('/api/users/{id}', ['item']),
]);

$provider->getLinks();             // iterable
$provider->getLinksByRel('item');  // iterable matching the rel

// Evolvable methods return new instances
$provider = $provider->withLink(new Link('/api/users?page=2', ['next']));
$provider = $provider->withoutLink($link);
```

Development
-----------

[](#development)

```
composer install

composer test   # run the test suite (PHPUnit)
composer mago   # static analysis (Mago)
composer format # format code (Mago)
composer qa     # format, analyze, and test
```

License
-------

[](#license)

MIT

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance99

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

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

4d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/33836112?v=4)[Kevin From](/maintainers/kevinfrom)[@kevinfrom](https://github.com/kevinfrom)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/php-pico-http-link/health.svg)

```
[![Health](https://phpackages.com/badges/php-pico-http-link/health.svg)](https://phpackages.com/packages/php-pico-http-link)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[symfony/web-link

Manages links between resources

1.4k106.9M364](/packages/symfony-web-link)[fig/link-util

Common utility implementations for HTTP links

1.8k57.4M34](/packages/fig-link-util)[nocarrier/hal

application/hal builder / formatter for PHP 5.3+

2022.1M21](/packages/nocarrier-hal)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[justbetter/laravel-http3earlyhints

A HTTP3 Early Hints Middleware for Laravel

1977.0k4](/packages/justbetter-laravel-http3earlyhints)

PHPackages © 2026

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