PHPackages                             ww-site/filament-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. ww-site/filament-gallery

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

ww-site/filament-gallery
========================

Reusable Filament gallery plugin for media source browsing and picking.

v0.1.5(1mo ago)21proprietaryPHPPHP ^8.2

Since Apr 18Pushed 1mo agoCompare

[ Source](https://github.com/ww-site/filament-gallery)[ Packagist](https://packagist.org/packages/ww-site/filament-gallery)[ Docs](https://github.com/ww-site/filament-gallery)[ RSS](/packages/ww-site-filament-gallery/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (7)Versions (5)Used By (0)

WwGallery — Filament Gallery
============================

[](#wwgallery--filament-gallery)

Reusable Filament 5 gallery plugin built around two simple ideas:

- a `media_sources` entity describing where files live (disk + directory)
- a set of Filament UI primitives to upload, browse, pick and display those files

Install from [Packagist](https://packagist.org/packages/ww-site/filament-gallery) or via a Composer `path` repository during local development.

- **Package:** `ww-site/filament-gallery`
- **Namespace:** `WwGallery\FilamentGallery\`
- **Author:** Гончаров Степан —  —

What's included
---------------

[](#whats-included)

LayerClassPurposeModel`WwGallery\FilamentGallery\Models\MediaSource`Parent entity (`name`, `slug`, `is_active`)Model`WwGallery\FilamentGallery\Models\MediaSourceSetting`Key/value settings (e.g. `disk`, `directory`)Service`WwGallery\FilamentGallery\Services\MediaSourceBrowserService`List / upload / delete files on a sourceResource`WwGallery\FilamentGallery\Filament\Resources\MediaSources\MediaSourceResource`Admin CRUD for media sources and settingsPage`WwGallery\FilamentGallery\Filament\Pages\GalleryContent`Filament page to browse &amp; manage filesForm field`WwGallery\FilamentGallery\Forms\Components\MediaPicker`Upload + pick image from a media sourceColumn`WwGallery\FilamentGallery\Tables\Columns\MediaPreviewColumn`Table preview resolving disk from a sourceEntry`WwGallery\FilamentGallery\Infolists\Components\MediaPreviewEntry`Infolist preview resolving disk from a sourcePlugin`WwGallery\FilamentGallery\FilamentGalleryPlugin`Filament panel plugin entry pointProvider`WwGallery\FilamentGallery\FilamentGalleryServiceProvider`Loads migrations, config, views, langsInstallation in a host project
------------------------------

[](#installation-in-a-host-project)

1. Install via Composer from Packagist: ```
    composer require ww-site/filament-gallery
    ```

    Or, for local development from a path repository: ```
    "repositories": {
        "ww-gallery": { "type": "path", "url": "../packages/ww-gallery" }
    },
    "require": {
        "ww-site/filament-gallery": "dev-master"
    }
    ```
2. Run `composer update ww-site/filament-gallery`.
3. Register the plugin inside the target panel provider: ```
    ->plugin(\WwGallery\FilamentGallery\FilamentGalleryPlugin::make())
    ```
4. Run migrations: `php artisan migrate`.
5. (Optional) publish config/translations: ```
    php artisan vendor:publish --tag=filament-gallery-config
    php artisan vendor:publish --tag=filament-gallery-translations

    ```

### Filament admin theme &amp; Tailwind (styling)

[](#filament-admin-theme--tailwind-styling)

Filament 5 builds the panel CSS with **Vite** and **Tailwind CSS v4**. Your panel `theme.css` only includes utilities for files listed in `@source` directives. This package ships **Blade views** and **HTML built from PHP** (e.g. gallery thumbnails inside the MediaPicker modal). If you do not extend Tailwind’s content paths, those screens look unstyled (oversized images, missing layout).

In your host app, open the Filament theme file you pass to `->viteTheme(...)` (for example `resources/css/filament/admin/theme.css`) and add **both** lines (paths are relative to that file; adjust if your theme lives elsewhere):

```
/* Package Blade views */
@source '../../../../vendor/ww-site/filament-gallery/resources/views/**/*';

/* Tailwind classes inside PHP (HtmlString labels, etc.) */
@source '../../../../vendor/ww-site/filament-gallery/src/**/*.php';
```

Then rebuild assets:

```
npm run build
# or during development:
npm run dev
```

After every `composer update ww-site/filament-gallery`, run the build again if the package added or changed Tailwind classes.

Usage
-----

[](#usage)

### Seed a media source

[](#seed-a-media-source)

```
$source = \WwGallery\FilamentGallery\Models\MediaSource::create([
    'name' => 'Изображения категорий',
    'slug' => 'category-images',
    'is_active' => true,
]);
$source->settings()->create(['key' => 'disk',      'value' => 'public',     'sort_order' => 10]);
$source->settings()->create(['key' => 'directory', 'value' => 'categories', 'sort_order' => 20]);
```

### Pick an image inside a form

[](#pick-an-image-inside-a-form)

```
use WwGallery\FilamentGallery\Forms\Components\MediaPicker;

MediaPicker::make('image')
    ->label('Изображение категории')
    ->mediaSourceSlug('category-images')
    ->imagesOnly();
```

### Render a preview in a table

[](#render-a-preview-in-a-table)

```
use WwGallery\FilamentGallery\Tables\Columns\MediaPreviewColumn;

MediaPreviewColumn::make('image')
    ->label('Изображение')
    ->mediaSourceSlug('category-images');
```

### Render a preview in an infolist

[](#render-a-preview-in-an-infolist)

```
use WwGallery\FilamentGallery\Infolists\Components\MediaPreviewEntry;

MediaPreviewEntry::make('image')
    ->label('Изображение')
    ->mediaSourceSlug('category-images');
```

### Render a resized image URL

[](#render-a-resized-image-url)

```
media_source_image('slider-images', $path, [
    'width' => 1200,
    'height' => 600,
    'format' => 'webp',
    'quality' => 85,
    'crop' => true,
]);
```

If only `width` or only `height` is passed, the helper keeps the original image ratio.

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

[](#configuration)

Default config is in `config/filament-gallery.php`:

- `page.accepted_file_types` / `page.max_upload_size` — uploads on the gallery page
- `picker.accepted_file_types` / `picker.max_upload_size` — uploads via the MediaPicker
- `image.cache_disk` / `image.cache_directory` — where resized images are cached
- `image.default_quality` / `image.default_format` / `image.default_crop` — default image processing options
- `register_gallery_page` / `register_media_sources_resource` — toggles to hide pieces from a panel

Per-panel overrides live on the plugin:

```
FilamentGalleryPlugin::make()
    ->registerGalleryPage(false)
    ->registerMediaSourcesResource();
```

Translations
------------

[](#translations)

Package ships with `en` and `ru`. Add your own by publishing translations and editing `lang/vendor/filament-gallery//filament-gallery.php`.

Testing
-------

[](#testing)

Automated tests live in this package (PHPUnit + [Orchestra Testbench](https://github.com/orchestral/testbench)). They are **not** installed in host applications — only `require-dev` when you work on the package itself.

From the package root (e.g. a git clone or your monorepo `packages/ww-gallery`):

```
composer update
composer test
```

`composer test` runs `phpunit` using `phpunit.xml.dist`.

**What is covered today:**

- `MediaSource` — settings, `getDisk()` / `getDirectory()`, defaults
- `MediaSourceBrowserService` — listing, image filter, upload, delete with path prefix rules
- `FilamentGalleryPlugin` — stable plugin id

Contributors: add cases under `tests/Unit/` and keep `declare(strict_types=1);` on new files.

Roadmap
-------

[](#roadmap)

- lightbox/viewer for the gallery page
- multi-file MediaPicker mode
- per-source policies / authorization hooks
- PSR-4 autodiscovery inside the panel provider
- broader Filament/Livewire feature tests (optional)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

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

Every ~1 days

Total

3

Last Release

50d ago

### Community

Maintainers

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

---

Top Contributors

[![rasxod](https://avatars.githubusercontent.com/u/5847571?v=4)](https://github.com/rasxod "rasxod (5 commits)")

---

Tags

laravelmediagalleryfile-uploadfilamentfilamentphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ww-site-filament-gallery/health.svg)

```
[![Health](https://phpackages.com/badges/ww-site-filament-gallery/health.svg)](https://phpackages.com/packages/ww-site-filament-gallery)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[api-platform/laravel

API Platform support for Laravel

59156.3k10](/packages/api-platform-laravel)

PHPackages © 2026

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