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

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

waterloobae/tinymce
===================

TinyMCE and LaTeX support for Laravel, Livewire, and Filament

v1.2.5(3mo ago)0191↓33.3%MITBladePHP ^8.1|^8.2|^8.3|^8.4

Since Oct 24Pushed 3mo agoCompare

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

READMEChangelog (3)Dependencies (3)Versions (13)Used By (0)

TinyMCE + LaTeX for Laravel, Livewire &amp; Filament
====================================================

[](#tinymce--latex-for-laravel-livewire--filament)

A comprehensive Laravel package providing TinyMCE rich text editor with LaTeX/MathJax support for Laravel Blade, Livewire components, and Filament admin panels.

Features
--------

[](#features)

- 🎨 **TinyMCE 8** rich text editor with dark theme support
- 📐 **MathJax 3** for beautiful LaTeX equation rendering
- 🖼️ **Base64 image uploads** (no file storage needed)
- ⚡ **Livewire** compatible with reactive data binding
- 🎯 **Filament** custom field and infolist components
- 🎭 **Blade components** for easy integration
- 🌓 **Dark mode** automatic detection and switching
- 📦 **Zero configuration** - works out of the box

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

[](#installation)

Install via Composer:

```
composer require waterloobae/tinymce
```

The package will auto-register via Laravel's package discovery.

### Optional: Publish Views

[](#optional-publish-views)

If you want to customize the views:

```
php artisan vendor:publish --tag=tinymce-views
```

This will publish views to `resources/views/vendor/tinymce/`.

### License Key Configuration

[](#license-key-configuration)

The package automatically includes the GPL license key in TinyMCE initialization. If you experience editor loading issues or license warnings, ensure your `tinymce.init` configuration includes:

```
tinymce.init({
    // ... other config
    license_key: 'gpl',
    // ... rest of config
});
```

This is required when using TinyMCE via CDN with the GPL license.

Usage
-----

[](#usage)

### 1. Filament Form Field

[](#1-filament-form-field)

Use in your Filament resource schemas:

```
use Waterloobae\TinyMce\Forms\Components\TinyEditor;

// In your resource schema
TinyEditor::make('description')
    ->profile('simple') // 'minimal', 'simple', or 'full'
    ->columnSpanFull();
```

**Profiles:**

- `minimal` - Basic formatting (bold, italic, lists, links)
- `simple` - Standard features (formatting, images, tables, code)
- `full` - All features (media, code samples, preview, etc.)

**Custom Configuration:**

```
TinyEditor::make('content')
    ->plugins(['lists', 'link', 'image', 'table', 'code'])
    ->toolbar('bold italic | bullist numlist | link image')
    ->columnSpanFull();
```

### 2. Filament Table Column

[](#2-filament-table-column)

Display HTML with LaTeX rendering in Filament table listings:

```
use Waterloobae\TinyMce\Tables\Columns\HtmlWithLatex;

// In your table schema
HtmlWithLatex::make('content')
    ->label('Problem Content')
    ->limit(50)
    ->wrap();
```

**With all table column options:**

```
HtmlWithLatex::make('description')
    ->label('Description')
    ->limit(100)
    ->wrap()
    ->toggleable()
    ->searchable();
```

### 3. Filament Infolist Entry (View)

[](#3-filament-infolist-entry-view)

Display HTML with LaTeX rendering in Filament view pages:

```
use Waterloobae\TinyMce\Infolists\Components\HtmlWithLatex;

// In your infolist schema
HtmlWithLatex::make('description')
    ->label('Description')
    ->columnSpanFull();
```

Or use the standard TextEntry with custom view:

```
use Filament\Infolists\Components\TextEntry;

TextEntry::make('description')
    ->view('tinymce::infolists.components.html-with-latex')
    ->columnSpanFull();
```

### 4. Livewire Component

[](#4-livewire-component)

Use in any Livewire component:

```

```

**With Livewire properties:**

```
// Component class
class EditArticle extends Component
{
    public string $content = '';

    public function save()
    {
        Article::create([
            'content' => $this->content,
        ]);
    }
}
```

```

    Save

```

### 5. Regular Blade Forms

[](#5-regular-blade-forms)

Use in standard Laravel Blade forms (non-Livewire):

```

    @csrf

    Submit

```

### 6. Display HTML with LaTeX (Blade Component)

[](#6-display-html-with-latex-blade-component)

Render HTML content with LaTeX equations:

```

```

**With custom classes:**

```

```

LaTeX Support
-------------

[](#latex-support)

The package supports both inline and display math equations using standard LaTeX syntax:

**Inline equations:**

```
Einstein's famous equation: $E = mc^2$
Alternative syntax: \(E = mc^2\)

```

**Display equations:**

```
$$
\int_{a}^{b} f(x)dx
$$

Alternative syntax:
\[
\int_{a}^{b} f(x)dx
\]

```

Examples
--------

[](#examples)

### Complete Filament Resource Example

[](#complete-filament-resource-example)

```
