PHPackages                             iotronlab/tiptap-spatie-media - 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. iotronlab/tiptap-spatie-media

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

iotronlab/tiptap-spatie-media
=============================

Spatie Media Integration Support For Tiptap Editor

v1.0.0(1y ago)16MITPHPPHP ^8.2

Since Apr 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/iotron/tiptap-spatie-media)[ Packagist](https://packagist.org/packages/iotronlab/tiptap-spatie-media)[ Docs](https://github.com/iotronlab/tiptap-spatie-media)[ RSS](/packages/iotronlab-tiptap-spatie-media/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (17)Versions (3)Used By (0)

Spatie Media Integration Support for Tiptap Editor
==================================================

[](#spatie-media-integration-support-for-tiptap-editor)

[![Latest Version on Packagist](https://camo.githubusercontent.com/64798cc885d8559dd0d47ec16dc3bbc958080d870fec0044a09370e6ba4b2825/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696f74726f6e6c61622f7469707461702d7370617469652d6d656469612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iotronlab/tiptap-spatie-media)[![GitHub Tests Action Status](https://camo.githubusercontent.com/d0138761c514163dec7e64a5c2fb9ed5fc2d8428519fd92dd480351bb74086e5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696f74726f6e6c61622f7469707461702d7370617469652d6d656469612f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/iotronlab/tiptap-spatie-media/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/7bcdfa39aa6ab812e5067ceaadf97342b003582d74f3a20532996be681ae7eaa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696f74726f6e6c61622f7469707461702d7370617469652d6d656469612f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/iotronlab/tiptap-spatie-media/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f0dc71881304ca355498ad336af2f0ae346dda46680674a0bfea54e03ec0e38c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696f74726f6e6c61622f7469707461702d7370617469652d6d656469612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/iotronlab/tiptap-spatie-media)

Introduction
------------

[](#introduction)

**Spatie Media Integration Support for Tiptap Editor** is a package that seamlessly integrates the Tiptap Editor with Spatie's Media Library, providing an easy way to manage and upload media within your Tiptap Editor. Built specifically for Laravel and Filament, this package extends the functionalities of the popular [Tiptap Editor](https://filamentphp.com/plugins/awcodes-tiptap-editor), making it a breeze to handle images and media directly within your rich text editing experience.

This package allows developers to customize the `media_action` configuration of the Tiptap Editor with just a single line change, enabling media upload management via Filament's Spatie Media Library integration. Once set up, users can effortlessly manage their media, giving a seamless media management experience.

> **Note**: This package requires the Tiptap Editor to be installed before you can use it.

Features
--------

[](#features)

- Integrate Tiptap Editor with Spatie's Media Library.
- Easily upload and manage images within the Tiptap Text Editor.
- Supports customization via a simple configuration change.

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

[](#installation)

You can install the package via Composer:

```
composer require iotronlab/tiptap-spatie-media
```

⚡ Quick Setup
-------------

[](#-quick-setup)

To quickly integrate **Tiptap Spatie Media** into your Laravel project, simply run:

```
php artisan tiptap-spatie-media:install
```

This command will:

- Automatically publish the `filament-tiptap-editor.php` config file (if not already published).
- Inject the correct `media_action` class reference: ```
    'media_action' => \Iotronlab\TiptapSpatieMedia\TiptapSpatieMediaAction::class,
    ```
- Configure the editor to support media uploads via Spatie's Media Library.

✅ You're now ready to use Tiptap with Spatie Media support!

---

🛠 Manual Installation
---------------------

[](#-manual-installation)

Prefer to configure things manually? Follow these steps:

### 1. Publish the configuration file

[](#1-publish-the-configuration-file)

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

### 2. Update the configuration

[](#2-update-the-configuration)

In the published `config/filament-tiptap-editor.php`, locate the `media_action` key and modify it like so:

```
// Comment out or remove the default action
// 'media_action' => FilamentTiptapEditor\Actions\MediaAction::class,

// Replace with the custom media action
'media_action' => \Iotronlab\TiptapSpatieMedia\TiptapSpatieMediaAction::class,
```

💡 This change tells Filament's Tiptap Editor to use Spatie’s Media Library for managing media uploads.

---

You're now fully set up to manage media in Tiptap using the power of Spatie's Laravel Media Library!

Usage
-----

[](#usage)

Use the Tiptap Editor as you normally would:

```
TiptapEditor::make('description')
    ->columnSpanFull(),
```

Just ensure that you have updated the Tiptap Editor config file with the new `media_action`, and you're all set to manage media uploads seamlessly.

💡 TipTap Media Integration for Laravel Models
---------------------------------------------

[](#-tiptap-media-integration-for-laravel-models)

To enable **automated handling of media uploads and textareas** (like images embedded in rich text editors), use the provided trait:

### ✅ Recommended: Use the `HasTipTapMedia` Trait

[](#-recommended-use-the-hastiptapmedia-trait)

Add the trait to any Eloquent model where you want media handling to be automatic. The trait will **automatically detect columns** containing rich text or image uploads.

```
use Iotronlab\TiptapSpatieMedia\Trait\HasTipTapMedia;

class Article extends Model
{
    use HasTipTapMedia;

    protected $fillable = ['title', 'content', 'summary'];
}
```

No extra configuration needed—this approach handles `created` and `saved` events internally.

---

### ⚙️ Optional: Manual Integration

[](#️-optional-manual-integration)

If you prefer more control or don't want to use the trait, you can manually call the required methods in the model’s boot method:

```
use Iotronlab\TiptapSpatieMedia\TipTapMedia;

class Article extends Model
{
    protected static function booted()
    {
        parent::booted();

        self::created(function ($record) {
            TipTapMedia::OnCreated($record, ['column_name']); // Replace with your actual rich-text/image field(s)
        });

        self::saved(function ($record) {
            TipTapMedia::OnSaved($record, ['column_name']);
        });
    }
}
```

> 🔁 Replace `'column_name'` with the field(s) you want TipTap Media to process.

Testing
-------

[](#testing)

You can run the package tests using:

```
composer test
```

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)

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

License
-------

[](#license)

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

Support Us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/d86f2d9ed483439dbd7e63510e9aa3ec18223bfdc0479adaf3f9852408b1f8db/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f7469707461702d7370617469652d6d656469612e6a70673f743d31)](https://spatie.be/github-ad-click/tiptap-spatie-media)

We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).

Prerequisites
-------------

[](#prerequisites)

This package requires:

- PHP 8.2 or higher
- [Tiptap Editor](https://filamentphp.com/plugins/awcodes-tiptap-editor) (must be installed before using this package)
- [Filament Spatie Media Library Plugin](https://filamentphp.com/plugins/filament-spatie-media-library)

Ensure you have these dependencies installed to take full advantage of this package's features.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance47

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

435d ago

### Community

Maintainers

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

---

Top Contributors

[![krishzzi](https://avatars.githubusercontent.com/u/36711704?v=4)](https://github.com/krishzzi "krishzzi (4 commits)")[![iotron](https://avatars.githubusercontent.com/u/50877415?v=4)](https://github.com/iotron "iotron (1 commits)")

---

Tags

laraveliotronlabtiptap-spatie-media

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/iotronlab-tiptap-spatie-media/health.svg)

```
[![Health](https://phpackages.com/badges/iotronlab-tiptap-spatie-media/health.svg)](https://phpackages.com/packages/iotronlab-tiptap-spatie-media)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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