PHPackages                             matteomascellani/filament-preview-files - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. matteomascellani/filament-preview-files

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

matteomascellani/filament-preview-files
=======================================

Reusable Filament actions and views for file and ticket previews

v1.0.2(1mo ago)06↑400%MITBladePHP ^8.2

Since Mar 15Pushed 1mo agoCompare

[ Source](https://github.com/matteomascellani/filament-preview-files)[ Packagist](https://packagist.org/packages/matteomascellani/filament-preview-files)[ RSS](/packages/matteomascellani-filament-preview-files/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

filament-preview-files
======================

[](#filament-preview-files)

Reusable Filament v4 actions and Blade views for:

- media zoom preview (images and PDF)
- media open in new tab
- graceful fallback when URL is missing (red unavailable icon)

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

[](#requirements)

- Filament `^4.0`
- Spatie Media Library `^11.0`
- Laravel `^11.28|^12.0`
- PHP `^8.2`

Install
-------

[](#install)

### From Packagist (recommended)

[](#from-packagist-recommended)

```
composer require matteomascellani/filament-preview-files
```

### From local path (development)

[](#from-local-path-development)

Add to root `composer.json`:

```
{
  "repositories": [
    {
      "type": "path",
      "url": "packages/matteomascellani/filament-preview-files"
    }
  ]
}
```

Then require the package:

```
composer require matteomascellani/filament-preview-files:*
```

Service Provider
----------------

[](#service-provider)

The package uses Laravel auto-discovery via `extra.laravel.providers`, so in normal setups you do not need to register the provider manually.

If your project disables package discovery, register manually:

```
Matteomascellani\FilamentPreviewFiles\FilamentPreviewFilesServiceProvider::class,
```

Optional: publish config.

```
php artisan vendor:publish --tag=filament-preview-files-config
```

Usage
-----

[](#usage)

### 1) Use in a Filament table (Actions)

[](#1-use-in-a-filament-table-actions)

```
use Matteomascellani\FilamentPreviewFiles\Actions\MediaPreviewAction;
use Matteomascellani\FilamentPreviewFiles\Actions\MediaOpenAction;
use Matteomascellani\FilamentPreviewFiles\Actions\MediaZoomAction;
use Matteomascellani\FilamentPreviewFiles\Actions\MediaUnavailableAction;
```

```
->recordActions([
  // Wrapper that injects all table actions:
  // - zoom (only for image/pdf with valid URL)
  // - open in new tab (only with valid URL)
  // - unavailable fallback (red no-symbol when URL is missing)
  ...MediaPreviewAction::make(
    urlResolver: fn ($record) => $record->getUrl(),
    mimeResolver: fn ($record) => (string) $record->mime_type,
  ),
])
```

If you prefer separate actions, all single actions are still available:

```
->recordActions([
  MediaZoomAction::make(
    urlResolver: fn ($record) => $record->getUrl(),
    mimeResolver: fn ($record) => (string) $record->mime_type,
  ),

  MediaOpenAction::make(
    urlResolver: fn ($record) => $record->getUrl(),
  ),

  MediaUnavailableAction::make(
    urlResolver: fn ($record) => $record->getUrl(),
  ),
])
```

### 2) Use in a normal Blade view

[](#2-use-in-a-normal-blade-view)

You can include the package views directly, even outside Filament table actions.

Media zoom modal content:

```
@include('filament-preview-files::modals.media-zoom-content', [
  'url' => $url,
  'mimeType' => $mimeType,
  'label' => $label,
])
```

Helper component-like partial for link + zoom trigger:

```
@include('filament-preview-files::components.media-zoom-link', [
  'url' => $url,
  'mimeType' => $mimeType,
  'label' => $label,
])
```

Current Usage In This Project
-----------------------------

[](#current-usage-in-this-project)

- `app/Filament/Resources/System/MediaResource.php`
- `...MediaPreviewAction::make(...)` in table actions

Branching And Versioning
------------------------

[](#branching-and-versioning)

- `1.x`: Filament 3 compatible line (Laravel 11)
- `2.x`: Filament 4 compatible line

Suggested release policy:

- publish `v1.*` tags from `1.x`
- publish `v2.*` tags from `2.x`

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance89

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

5

Last Release

53d ago

Major Versions

v1.0.2 → 2.x-dev2026-03-15

### Community

Maintainers

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

---

Top Contributors

[![matteomascellani](https://avatars.githubusercontent.com/u/41450442?v=4)](https://github.com/matteomascellani "matteomascellani (15 commits)")

### Embed Badge

![Health badge](/badges/matteomascellani-filament-preview-files/health.svg)

```
[![Health](https://phpackages.com/badges/matteomascellani-filament-preview-files/health.svg)](https://phpackages.com/packages/matteomascellani-filament-preview-files)
```

###  Alternatives

[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[bezhansalleh/filament-google-analytics

Google Analytics integration for FilamentPHP

205144.8k5](/packages/bezhansalleh-filament-google-analytics)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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