PHPackages                             anhnt0212/filament-media-browser - 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. anhnt0212/filament-media-browser

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

anhnt0212/filament-media-browser
================================

Media browser modal for Filament RichEditor - browse and insert existing images, auto SEO filenames

06Blade

Since Mar 23Pushed 3mo agoCompare

[ Source](https://github.com/evansnguyen0104/filament-media-browser)[ Packagist](https://packagist.org/packages/anhnt0212/filament-media-browser)[ RSS](/packages/anhnt0212-filament-media-browser/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Filament Media Browser
======================

[](#filament-media-browser)

A lightweight media browser for Filament RichEditor. Browse and insert existing images without any extra packages.

Features
--------

[](#features)

- **Media Browser Modal** - Browse existing uploaded images in a grid, click to insert directly into RichEditor
- **SEO Filenames** - Auto-rename uploaded images based on the post title (e.g. "Đây là hình" → `day-la-hinh-a3x9k2.png`)
- **Multiple Directories** - Switch between different storage directories (images, blogs, etc.)
- **Pagination** - Browse large media libraries with ease
- **Dark Mode** - Full support for Filament dark mode
- **Zero Dependencies** - Uses Alpine.js (built into Filament), no extra JS libraries needed

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

[](#installation)

```
composer require anhnt0212/filament-media-browser
```

Publish the config (optional):

```
php artisan vendor:publish --tag=media-browser-config
```

Publish views for customization (optional):

```
php artisan vendor:publish --tag=media-browser-views
```

Usage
-----

[](#usage)

### Basic - Add Media Browser to your Resource

[](#basic---add-media-browser-to-your-resource)

```
use Anhnt0212\FilamentMediaBrowser\Forms\Components\MediaBrowser;

public static function form(Form $form): Form
{
    return $form->schema([
        // ... other fields

        MediaBrowser::make(),

        RichEditor::make('content')
            ->fileAttachmentsDisk('public')
            ->fileAttachmentsDirectory('images'),
    ]);
}
```

### With SEO Filenames

[](#with-seo-filenames)

Auto-rename uploaded images based on a form field:

```
MediaBrowser::make()
    ->slugFrom('title'),  // Uses the 'title' field to generate SEO filenames
```

When you upload an image and the title is "Dịch vụ tăng like Facebook", the filename becomes: `dich-vu-tang-like-facebook-x7k2m9.png`

### Custom Directory

[](#custom-directory)

```
MediaBrowser::make()
    ->directory('blogs')     // Default directory to browse
    ->slugFrom('title'),
```

### Full RichEditor with SEO Upload

[](#full-richeditor-with-seo-upload)

```
MediaBrowser::make()
    ->slugFrom('title'),

RichEditor::make('content')
    ->fileAttachmentsDisk('public')
    ->fileAttachmentsDirectory('images')
    ->saveUploadedFileAttachmentsUsing(function ($file, $get) {
        $name = $get('title') ?: pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
        $slug = \Illuminate\Support\Str::slug($name ?: 'image');
        $filename = $slug . '-' . \Illuminate\Support\Str::random(6) . '.' . $file->getClientOriginalExtension();

        $path = $file->storeAs('images', $filename, 'public');

        return \Illuminate\Support\Facades\Storage::disk('public')->url($path);
    }),
```

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

[](#configuration)

```
// config/media-browser.php

return [
    'disk' => 'public',                          // Storage disk
    'directories' => ['images', 'blogs'],         // Browsable directories
    'default_directory' => 'images',              // Default selected directory
    'per_page' => 24,                             // Images per page
    'extensions' => ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'],
    'middleware' => ['web', 'auth:admin'],         // Auth middleware
    'route_prefix' => 'admin',                    // Route prefix
];
```

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12
- Filament 3.x

License
-------

[](#license)

MIT

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance55

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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.

### Community

Maintainers

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

---

Top Contributors

[![evansnguyen0104](https://avatars.githubusercontent.com/u/13174717?v=4)](https://github.com/evansnguyen0104 "evansnguyen0104 (2 commits)")

### Embed Badge

![Health badge](/badges/anhnt0212-filament-media-browser/health.svg)

```
[![Health](https://phpackages.com/badges/anhnt0212-filament-media-browser/health.svg)](https://phpackages.com/packages/anhnt0212-filament-media-browser)
```

###  Alternatives

[goat1000/svggraph

Generates SVG graphs

133890.0k3](/packages/goat1000-svggraph)[imagekit/imagekit

PHP library for Imagekit

46877.3k10](/packages/imagekit-imagekit)[gravatarphp/gravatar

Gravatar URL builder which is most commonly called as a Gravatar library

12644.1k2](/packages/gravatarphp-gravatar)

PHPackages © 2026

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