PHPackages                             digitonic/photonic-filament - 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. digitonic/photonic-filament

ActiveLibrary[Image &amp; Media](/categories/media)

digitonic/photonic-filament
===========================

The Photonic Field is a custom input component designed specifically for ingesting pictures and returning an appropriate CDN link for them

2.1.0(2mo ago)0209MITPHPPHP ^8.2|^8.3|^8.4|^8.5CI failing

Since Jan 15Pushed 2mo agoCompare

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

READMEChangelog (6)Dependencies (11)Versions (11)Used By (0)

Photonic Filament Package
=========================

[](#photonic-filament-package)

A Filament 4 form component package for Laravel 12 that uploads image assets to a third‑party Photonic API, stores metadata in your database, and renders CDN image URLs. It does not persist the uploaded file locally.

We intend this package to be used with the Photonic Server API.

Features
--------

[](#features)

- Optionally records each upload to a dedicated `photonic` table.
- Includes form component:
    - `PhotonicImageField` – composite helper (upload + preview + delete + meta info).
- Blade component `` for rendering CDN URLs.
- Helpers:
    - `photonic_asset($filename, $assetUuid, $preset = 'original')` URL builder.
    - `get_photonic_table_name()` resolves the media table from config.

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

[](#installation)

```
composer require digitonic/photonic-filament
```

### 1. Run the installer

[](#1-run-the-installer)

```
php artisan photonic-filament:install
```

The installer will prompt you for the required Photonic values and will update **both** your `.env` and `.env.example`.

### 2. Publish and run migrations

[](#2-publish-and-run-migrations)

```
php artisan vendor:publish --tag=photonic-filament-migrations
php artisan migrate
```

This creates the `photonic` table in your database to store image metadata.

### Optional: Publish config and views

[](#optional-publish-config-and-views)

If you want to customize the config or views:

```
php artisan vendor:publish --tag=photonic-filament-config
php artisan vendor:publish --tag=photonic-filament-views
```

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

[](#configuration)

All options live in `config/photonic-filament.php` and can be set via environment variables:

KeyEnv varDefaultDescriptionendpointPHOTONIC\_ENDPOINTBase API URL used by the Saloon connector.cdn\_endpointPHOTONIC\_CDN\_ENDPOINTBase CDN URL for image rendering.site\_uuidPHOTONIC\_SITE\_UUID(null)Site identifier sent with each upload.api\_keyPHOTONIC\_API\_KEY(null)Bearer API token.file\_fieldPHOTONIC\_FILE\_FIELDfileMultipart field name for the uploaded file.response\_keyPHOTONIC\_RESPONSE\_KEYoriginal\_filenameJSON key inside `data` used to pull the stored filename.media\_model(class)`Digitonic\Photonic\Filament\Models\Media::class`Eloquent model used to persist uploads.Trait: `UsesPhotonic`
---------------------

[](#trait-usesphotonic)

```
use Digitonic\Photonic\Filament\Concerns\UsesPhotonic;

class Article extends Model
{
    use UsesPhotonic;
}
```

- `$article->photonicMedia` (morphOne)
- `$article->addPhotonicMedia($filename, $presetsArray)`
- `$article->removePhotonicMedia($mediaId)`

Components
----------

[](#components)

### `PhotonicImageField`

[](#photonicimagefield)

```
use Digitonic\Photonic\Filament\Forms\Components\PhotonicImageField;

PhotonicImageField::make();
```

Blade component
---------------

[](#blade-component)

```

```

Fluent API
----------

[](#fluent-api)

The primary API is a facade-first fluent resolver:

```
use Digitonic\Photonic\Filament\Facades\Photonic;
use Digitonic\Photonic\Filament\Enums\PresetEnum;

$url = Photonic::for($mediaIdOrMediaModel)
    ->preset(PresetEnum::ORIGINAL)
    ->url(); // ?string

$media = Photonic::for($mediaIdOrMediaModel)
    ->media(); // ?Media

$info = Photonic::for($mediaIdOrMediaModel)
    ->preset('featured')
    ->info(); // ?PhotonicInfo
```

`PresetEnum::AUTO` is available when you want the API-generated auto WebP preset.

`PhotonicInfo` is immutable and provides:

- `id`
- `assetUuid`
- `filename`
- `preset`
- `url`
- `alt`
- `title`
- `description`
- `caption`
- `config`
- `createdAt`
- `updatedAt`

It supports `toArray()` and `jsonSerialize()`.

When media cannot be resolved, `url()`, `media()`, and `info()` all return `null`.

Helper functions (Compatibility)
--------------------------------

[](#helper-functions-compatibility)

- `photonic_asset(string $filename, string $assetUuid, string $preset = 'original'): ?string;`
- `photonic_asset_by_id(int $mediaId, string $preset = 'original', int $cacheTtl = 3600): ?string;`
- `photonic_media_by_id(int $mediaId, int $cacheTtl = 3600): ?Media;`
- `forget_photonic_cache(int $mediaId): void;`
- `get_photonic_table_name(): string;`

License
=======

[](#license)

Copyright 2026, Digitonic

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

```
http://www.apache.org/licenses/LICENSE-2.0

```

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance83

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.6% 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 ~4 days

Total

8

Last Release

86d ago

Major Versions

1.0.5 → 2.0.02026-02-11

PHP version history (2 changes)1.0.0PHP ^8.2|^8.3|^8.4

2.0.0PHP ^8.2|^8.3|^8.4|^8.5

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104549?v=4)[Steven Richardson](/maintainers/richdynamix)[@richdynamix](https://github.com/richdynamix)

---

Top Contributors

[![SOD96](https://avatars.githubusercontent.com/u/9489645?v=4)](https://github.com/SOD96 "SOD96 (81 commits)")[![richdynamix](https://avatars.githubusercontent.com/u/1104549?v=4)](https://github.com/richdynamix "richdynamix (2 commits)")

---

Tags

cdnimagesmedialaravelfilament

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/digitonic-photonic-filament/health.svg)

```
[![Health](https://phpackages.com/badges/digitonic-photonic-filament/health.svg)](https://phpackages.com/packages/digitonic-photonic-filament)
```

###  Alternatives

[awcodes/filament-curator

A media picker plugin for FilamentPHP.

434297.7k19](/packages/awcodes-filament-curator)[joaopaulolndev/filament-pdf-viewer

Filament package to show pdf document viewer

104147.2k3](/packages/joaopaulolndev-filament-pdf-viewer)[webplusm/gallery-json-media

a filament media storing in a Json field

196.0k](/packages/webplusm-gallery-json-media)[tomatophp/filament-media-manager

Manage your media files using spatie media library with easy to use GUI for FilamentPHP

14543.9k3](/packages/tomatophp-filament-media-manager)[johncarter/filament-focal-point-picker

An image focal point picker for Filament Admin.

4326.5k1](/packages/johncarter-filament-focal-point-picker)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)

PHPackages © 2026

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