PHPackages                             chuoke/unify-gallery - 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. [Image &amp; Media](/categories/media)
4. /
5. chuoke/unify-gallery

Abandoned → [chuoke/media-bridge](/?search=chuoke%2Fmedia-bridge)Library[Image &amp; Media](/categories/media)

chuoke/unify-gallery
====================

A unified bridge for multiple media sources: Unsplash, Pexels, Pixabay, Bing and more

v2.0.0(2mo ago)025MITPHPPHP ^8.1CI passing

Since Jan 18Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/chuoke/media-bridge)[ Packagist](https://packagist.org/packages/chuoke/unify-gallery)[ Docs](https://github.com/chuoke/media-bridge)[ GitHub Sponsors](https://github.com/chuoke)[ RSS](/packages/chuoke-unify-gallery/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (6)Versions (22)Used By (0)

chuoke/media-bridge
===================

[](#chuokemedia-bridge)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5db7d54de4068f378d44f5d065df89c0e13443743f1a3c6907cef98ae406094d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368756f6b652f6d656469612d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chuoke/media-bridge)[![Tests](https://github.com/chuoke/media-bridge/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/chuoke/media-bridge/actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/ee7a42c4106ab9ca6b1cc718c7bb3100e0c6698facd74b570f5f17b786f3f73a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368756f6b652f6d656469612d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/chuoke/media-bridge)

A unified bridge for multiple media sources — search photos and videos from Unsplash, Pexels, Pixabay, Bing, Wikimedia Commons, and NASA through a single consistent interface.

This package was renamed from `chuoke/unify-gallery` to `chuoke/media-bridge` in v2.

Supported Sources
-----------------

[](#supported-sources)

DriverSearchBrowseAPI KeyMedia TypesBing✗✓NoPhotoUnsplash✓✓YesPhotoPexels✓✓YesPhoto, VideoPixabay✓✓YesPhoto, VideoWikimedia✓✓NoPhoto, VideoNASA✓✓NoPhoto, VideoInstallation
------------

[](#installation)

```
composer require chuoke/media-bridge
```

For Laravel integration, also install:

```
composer require illuminate/support
```

Usage
-----

[](#usage)

### Standalone

[](#standalone)

```
use Chuoke\MediaBridge\MediaManager;

$manager = new MediaManager([
    'default' => 'unsplash',
    'drivers' => [
        'unsplash' => ['api_key' => 'your-unsplash-key'],
        'pexels'   => ['api_key' => 'your-pexels-key'],
        'pixabay'  => ['api_key' => 'your-pixabay-key'],
    ],
]);

// Search photos
$result = $manager->driver('pexels')->search('mountain', page: 1, perPage: 20);

// Browse without query (Bing, Wikimedia; NASA falls back to a generic feed)
$result = $manager->driver('bing')->search();

// Use default driver
$result = $manager->search('ocean');

foreach ($result->items as $item) {
    echo $item->source;       // 'pexels'
    echo $item->url;          // full image URL
    echo $item->thumb_url;    // thumbnail URL
    print_r($item->variants); // available size / asset variants
    echo $item->author_name;  // photographer name
    echo $item->license;      // 'pexels', 'cc0', etc.
}
```

### Extra Parameters

[](#extra-parameters)

```
$result = $manager->driver('pixabay')->search('forest', extras: [
    'orientation' => 'landscape',   // 'landscape' | 'portrait' | 'squarish'
    'color'       => 'green',
    'media_type'  => 'video',       // 'photo' | 'video'
    'locale'      => 'zh-CN',
]);
```

### Media Variants

[](#media-variants)

```
foreach ($item->variants as $variant) {
    echo $variant->type;   // 'thumb', 'small', 'large', 'original', etc.
    echo $variant->url;
    echo $variant->width;
    echo $variant->height;
}
```

### Pagination

[](#pagination)

```
$result = $manager->driver('wikimedia')->search('', perPage: 20);

if ($result->hasMore) {
    $next = $manager->driver('wikimedia')->search('', perPage: 20, extras: [
        'cursor' => $result->nextPage,
    ]);
}
```

Most drivers return the next numeric page in `nextPage`. Cursor-based sources such as Wikimedia may return an opaque token array; pass it back as `extras['cursor']`.

Bing only exposes a shallow daily archive feed. The driver fetches the available archive batches internally, deduplicates repeated items by `source_id`, and then paginates the merged result locally.

`MediaResult` fields:

FieldTypeDescription`items``MediaItem[]`Result items`total``int`Total count when available`has_more``bool`Whether another page is available`page``int`Current numeric page`per_page``int`Requested page size`next_page``int|string|array|null`Next page number or cursor token### Check Driver Capabilities

[](#check-driver-capabilities)

```
$driver = $manager->driver('bing');

$driver->source();        // 'bing'
$driver->searchable();    // false — Bing does not support keyword search
$driver->requiresApiKey(); // false
```

### Laravel

[](#laravel)

If you are using a full Laravel application, the required Illuminate packages are already present.

Publish the config file:

```
php artisan vendor:publish --tag="media-bridge-config"
```

Configure your API keys in `config/media-bridge.php` or via environment variables:

```
UNSPLASH_API_KEY=your-key
PEXELS_API_KEY=your-key
PIXABAY_API_KEY=your-key
```

Use the facade:

```
use Chuoke\MediaBridge\Laravel\Media;

$result = Media::driver('unsplash')->search('sunset');
$result = Media::search('cat'); // uses default driver
```

When the package runs inside a Laravel application, outgoing requests use Laravel's `Http` client automatically. That allows Laravel-side tooling such as Telescope to observe these requests. Outside Laravel, the package continues to use Guzzle directly.

MediaItem Fields
----------------

[](#mediaitem-fields)

FieldTypeDescription`source``string`Driver name, e.g. `'unsplash'``source_id``string`Stable ID from the source platform`media_type``string``'photo'` or `'video'``url``string`Best available direct media URL`thumb_url``string`Thumbnail URL`variants``array`Available media variants`download_url``string|null`Download trigger URL (Unsplash)`title``string|null`Title if provided by source`description``string|null`Description if provided by source`author_name``string|null`Photographer / uploader name`author_url``string|null`Link to author profile`license``string`License identifier, e.g. `'cc0'``width``int|null`Image width in pixels`height``int|null`Image height in pixels`color``string|null`Dominant color hex (if available)`tags``array`Keyword tags`display_date``string|null`Date string `YYYY-MM-DD`Testing
-------

[](#testing)

```
composer test
```

The default test suite uses mocked HTTP responses and does not require API keys or network access.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [chuoke](https://github.com/chuoke)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance86

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 53.3% 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

Every ~110 days

Recently: every ~242 days

Total

15

Last Release

80d ago

Major Versions

v1.0.13 → v2.0.02026-04-15

PHP version history (2 changes)v1.0.0PHP ^8.0

v2.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d610c8864bc961881283567007e0e0e2a78f6d69a3df114256ea78d7bcbf78da?d=identicon)[chuoke](/maintainers/chuoke)

---

Top Contributors

[![chuoke](https://avatars.githubusercontent.com/u/17611457?v=4)](https://github.com/chuoke "chuoke (32 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (12 commits)")

---

Tags

imagemediagalleryUnsplashbingpexelsPixabaychuoke

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/chuoke-unify-gallery/health.svg)

```
[![Health](https://phpackages.com/badges/chuoke-unify-gallery/health.svg)](https://phpackages.com/packages/chuoke-unify-gallery)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[classic-o/nova-media-library

Tool and field that will let you managing files and add them to the posts

154180.4k](/packages/classic-o-nova-media-library)[jolicode/media-bundle

A media management bundle for Symfony applications, with Easyadmin and SonataAdmin integrations.

11213.6k](/packages/jolicode-media-bundle)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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