PHPackages                             iamgerwin/filament-tinymce - 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. [Templating &amp; Views](/categories/templating)
4. /
5. iamgerwin/filament-tinymce

ActiveLibrary[Templating &amp; Views](/categories/templating)

iamgerwin/filament-tinymce
==========================

TinyMCE editor field for Filament v4 with full customization support

v1.0.0(7mo ago)12MITPHPPHP ^8.3CI passing

Since Sep 22Pushed 7mo agoCompare

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

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

Filament TinyMCE Editor
=======================

[](#filament-tinymce-editor)

[![Latest Version on Packagist](https://camo.githubusercontent.com/36a4fbbd388b791a8495774bd1a74edfc05f3e882497a185c9fccf9526bf6a3b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69616d67657277696e2f66696c616d656e742d74696e796d63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iamgerwin/filament-tinymce)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6990eebd732650bb3d8eff32c66c65047d40c7e0855a3c935e54b93ea958f8d0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f69616d67657277696e2f66696c616d656e742d74696e796d63652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/iamgerwin/filament-tinymce/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/c0706a8df4f532e41e4b6d9bcefb748bc681c5e69b0f026f6d76ad5573abac31/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f69616d67657277696e2f66696c616d656e742d74696e796d63652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/iamgerwin/filament-tinymce/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/0989318624c8d92148a6c793c2167dbb8e7c8a27bff09b1c4286e7ab3c28898e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69616d67657277696e2f66696c616d656e742d74696e796d63652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iamgerwin/filament-tinymce)

A powerful and flexible TinyMCE rich text editor field for Filament v3, featuring comprehensive customization options, image uploads, dark mode support, and multiple editor profiles.

Features
--------

[](#features)

- 🎨 **Full TinyMCE 6 Integration** - Complete access to TinyMCE's powerful editing capabilities
- 🌓 **Dark Mode Support** - Seamless theme switching that follows Filament's theme
- 📸 **Image Upload** - Built-in image upload with configurable storage options
- ⚙️ **Highly Customizable** - Configure plugins, toolbar, and initialization options
- 📱 **Responsive Design** - Mobile-optimized editor configuration
- 🚀 **Multiple Profiles** - Pre-configured editor profiles (simple, standard, full)
- 🔒 **Secure** - Built-in CSRF protection and authentication checks for uploads
- 🎯 **PHP 8.3 Optimized** - Leveraging modern PHP features for better performance

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

[](#requirements)

- PHP ^8.3
- Laravel ^11.0
- Filament ^3.2

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

[](#installation)

You can install the package via composer:

```
composer require iamgerwin/filament-tinymce
```

Publish the configuration file:

```
php artisan vendor:publish --tag="filament-tinymce-config"
```

Optionally, publish the assets:

```
php artisan vendor:publish --tag="filament-tinymce-assets"
```

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

[](#configuration)

### TinyMCE API Key

[](#tinymce-api-key)

To use TinyMCE cloud, add your API key to your `.env` file:

```
TINYMCE_API_KEY=your-api-key-here
TINYMCE_CLOUD_CHANNEL=6
```

You can get a free API key from [TinyMCE](https://www.tiny.cloud/get-tiny/).

### Configuration File

[](#configuration-file)

The configuration file `config/filament-tinymce.php` provides extensive customization options:

```
return [
    'api_key' => env('TINYMCE_API_KEY', ''),
    'cloud_channel' => env('TINYMCE_CLOUD_CHANNEL', '6'),
    'show_menu_bar' => false,
    'min_height' => 256,
    'max_height' => 0, // 0 = no limit

    'plugins' => [
        'advlist', 'anchor', 'autolink', 'autoresize', 'autosave',
        'charmap', 'code', 'codesample', 'directionality', 'emoticons',
        'fullscreen', 'help', 'image', 'insertdatetime', 'link',
        'lists', 'media', 'pagebreak', 'preview', 'quickbars',
        'searchreplace', 'table', 'visualblocks', 'visualchars', 'wordcount'
    ],

    'toolbar' => [
        'undo redo restoredraft | styles | bold italic underline strikethrough',
        'alignleft aligncenter alignright alignjustify | outdent indent',
        'blocks fontfamily fontsize | forecolor backcolor',
        'bullist numlist | link image media table | code fullscreen preview'
    ],

    'upload_images' => [
        'enabled' => false,
        'disk' => 'public',
        'folder' => 'images',
        'max_size' => 2048, // in KB
    ],

    // Pre-configured profiles
    'profiles' => [
        'simple' => [...],
        'standard' => [...],
        'full' => [...]
    ]
];
```

Usage
-----

[](#usage)

### Basic Usage

[](#basic-usage)

```
use Iamgerwin\FilamentTinymce\Forms\Components\TinymceEditor;

TinymceEditor::make('content')
    ->label('Content')
    ->required()
```

### Simple Profile

[](#simple-profile)

For basic text editing needs:

```
TinymceEditor::make('description')
    ->simple()
```

### With Image Uploads

[](#with-image-uploads)

Enable image uploads with custom configuration:

```
TinymceEditor::make('content')
    ->uploadImages()
    ->uploadDisk('s3')
    ->uploadDirectory('blog/images')
    ->uploadMaxSize(4096) // 4MB
```

### Custom Toolbar and Plugins

[](#custom-toolbar-and-plugins)

```
TinymceEditor::make('content')
    ->plugins(['link', 'image', 'code', 'table'])
    ->toolbar([
        'undo redo | bold italic underline',
        'link image table | code'
    ])
    ->showMenuBar()
```

### Height Configuration

[](#height-configuration)

```
TinymceEditor::make('content')
    ->minHeight(400)
    ->maxHeight(800)
```

### Advanced Configuration

[](#advanced-configuration)

```
TinymceEditor::make('content')
    ->apiKey('your-custom-api-key')
    ->cloudChannel('7')
    ->init([
        'branding' => false,
        'promotion' => false,
        'browser_spellcheck' => true,
        'paste_as_text' => true,
        'autosave_interval' => '30s',
        'autosave_retention' => '60m',
        'content_style' => 'body { font-family: Arial; font-size: 16px; }'
    ])
```

### Using in Resource Forms

[](#using-in-resource-forms)

```
namespace App\Filament\Resources\PostResource\Pages;

use App\Filament\Resources\PostResource;
use Filament\Resources\Pages\CreateRecord;
use Iamgerwin\FilamentTinymce\Forms\Components\TinymceEditor;

class CreatePost extends CreateRecord
{
    protected static string $resource = PostResource::class;

    protected function getFormSchema(): array
    {
        return [
            Forms\Components\TextInput::make('title')
                ->required()
                ->maxLength(255),

            TinymceEditor::make('content')
                ->label('Post Content')
                ->required()
                ->uploadImages()
                ->uploadDirectory('posts/' . date('Y/m'))
                ->minHeight(500),

            Forms\Components\Toggle::make('is_published')
                ->label('Publish immediately')
        ];
    }
}
```

### Validation

[](#validation)

The field works seamlessly with Laravel's validation rules:

```
TinymceEditor::make('content')
    ->required()
    ->minLength(100)
    ->maxLength(5000)
    ->rules(['string', 'max:5000'])
```

### Read-only and Disabled States

[](#read-only-and-disabled-states)

```
TinymceEditor::make('content')
    ->disabled()
    // or
    ->readonly()
    // or conditionally
    ->disabled(fn () => ! auth()->user()->isAdmin())
```

Advanced Features
-----------------

[](#advanced-features)

### Dark Mode Support

[](#dark-mode-support)

The editor automatically adapts to Filament's dark mode. No additional configuration needed.

### Autosave

[](#autosave)

Configure autosave functionality:

```
TinymceEditor::make('content')
    ->init([
        'autosave_interval' => '20s',
        'autosave_retention' => '30m',
        'autosave_restore_when_empty' => true,
    ])
```

### Custom CSS Styling

[](#custom-css-styling)

Apply custom styles to the editor content:

```
TinymceEditor::make('content')
    ->init([
        'content_style' => '
            body {
                font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
                line-height: 1.6;
                color: #333;
            }
            h1 { color: #2563eb; }
            blockquote {
                border-left: 4px solid #e5e7eb;
                padding-left: 1rem;
                color: #6b7280;
            }
        '
    ])
```

### Mobile Configuration

[](#mobile-configuration)

Different configuration for mobile devices:

```
TinymceEditor::make('content')
    ->init([
        'mobile' => [
            'menubar' => false,
            'plugins' => 'autosave lists link image',
            'toolbar' => 'undo bold italic styles link image',
        ]
    ])
```

Image Upload Security
---------------------

[](#image-upload-security)

When enabling image uploads, the package includes:

- File type validation (images only)
- File size validation
- Automatic file name sanitization
- CSRF protection
- Authentication checks

Configure in your `config/filament-tinymce.php`:

```
'upload_images' => [
    'enabled' => true,
    'disk' => 's3', // or 'local', 'public'
    'folder' => 'uploads/tinymce',
    'max_size' => 2048, // KB
],
```

Testing
-------

[](#testing)

Run the test suite:

```
composer test
```

Run tests with coverage:

```
composer test-coverage
```

Run PHPStan analysis:

```
./vendor/bin/phpstan analyse
```

Format code with Pint:

```
composer format
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

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

This package is inspired by [Nova4-TinymceEditor](https://github.com/murdercode/Nova4-TinymceEditor) and uses the [Spatie Laravel Package Skeleton](https://github.com/spatie/package-skeleton-laravel).

License
-------

[](#license)

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

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance62

Regular maintenance activity

Popularity4

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

Unknown

Total

1

Last Release

238d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8f6f1736b8e2833ccb6c4098e4ecb5081d9cd5db2af370fde0365d441fbfbf59?d=identicon)[iamgerwin](/maintainers/iamgerwin)

---

Top Contributors

[![iamgerwin](https://avatars.githubusercontent.com/u/1331683?v=4)](https://github.com/iamgerwin "iamgerwin (7 commits)")

---

Tags

laraveleditorwysiwygtinymcefilamentrich textiamgerwin

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/iamgerwin-filament-tinymce/health.svg)

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

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[amidesfahani/filament-tinyeditor

Filament TinyMce Editor

99328.8k4](/packages/amidesfahani-filament-tinyeditor)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)[ktquez/laravel-tinymce

TinyMCE editor for Laravel and Lumen Framework

2525.4k](/packages/ktquez-laravel-tinymce)[mwguerra/filemanager

A full-featured file manager package for Laravel and Filament v5 with dual operating modes, drag-and-drop uploads, S3/MinIO support, and comprehensive security features.

718.5k1](/packages/mwguerra-filemanager)[tapp/filament-webhook-client

Add a Filament resource and a policy for Spatie Webhook client

1120.2k](/packages/tapp-filament-webhook-client)

PHPackages © 2026

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