Download the PHP package mateuslecchi/filament-rich-editor-extender without Composer

On this page you can find all versions of the php package mateuslecchi/filament-rich-editor-extender. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-rich-editor-extender

A set of extra extensions for Filament RichEditor

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Extra goodies for the Filament Forms RichEditor (v5). This package ships small, focused extensions that plug straight into your existing editor.

Currently included:

Requirements

Package Version PHP Version Laravel Version Filament Forms Version
1.x 8.4+ 13+ 5.6+

Installation

You can install the package via composer:

Then run the package installer:

Usage

Once installed, all tools will be available for all RichEditor instances. The plugin registers itself automatically, so no additional configuration is required.

YouTube

Add the youtube button to your editor's toolbar. It opens a modal asking for a YouTube URL and inserts the video as an embed.

Embeds use the privacy-enhanced youtube-nocookie.com domain by default. See Displaying stored content for how to register the YoutubePlugin when rendering, and Sanitization for the host allowlist.

Twitch

Add the twitch button to your editor's toolbar. It opens a modal asking for a Twitch URL (video, clip or channel) and inserts it as an embed.

⚠️ Twitch requires a parent domain. Every Twitch embed must declare the domain(s) it is served from, or the player refuses to load. Publish the config and set twitch.parent to the domain(s) where your rendered content is shown (no scheme, no path). The live editor preview derives its parent from the current host automatically — this setting only applies to server-side rendered embeds.

See Displaying stored content for how to register the TwitchPlugin when rendering, and Sanitization for the host allowlist.

X (Twitter)

Add the x button to your editor's toolbar. It opens a modal asking for an X (or legacy Twitter) post URL and inserts the post as an embed.

Posts are embedded via an <iframe> pointing at platform.twitter.com, so the embed survives sanitization and server-side rendering just like the other media. Both x.com/.../status/<id> and twitter.com/.../status/<id> URLs are accepted — the package extracts the post id and builds the embed URL for you. See Displaying stored content for how to register the XPlugin when rendering.

ℹ️ Resizing. An X post iframe has a fixed height, so tall posts (with images or quotes) would be cropped. The editor resizes them automatically. On your front-end pages, include the small resize script so displayed posts fit their content — see Resizing X embeds on the front-end.

Storage modes (HTML or JSON)

Filament can store RichEditor content as HTML (its native default) or as a structured JSON document. Every embed in this package works in both — pick what fits your app:

HTML (default) JSON
Column text / longText, no cast json, or cast the attribute to array
Field ->youtubeStorage() (or nothing) ->youtubeStorage('json') (or Filament's ->json())
Stored value ready-to-use HTML structured document

Use the per-field helper to follow the package's configured default:

The ->youtubeStorage() helper toggles the field's storage mode (HTML vs JSON); it is not YouTube-specific and applies regardless of which embeds the field uses.

The default mode is read from config('filament-rich-editor-extender.storage') ('html' out of the box). The helper is opt-in per field — it never changes the storage mode of your other RichEditor fields. For JSON mode, remember to make the column array-castable:

⚠️ Switching an existing field between HTML and JSON changes the stored format. Migrate the column/cast and the existing rows accordingly — the package does not convert data for you.

Displaying stored content

When you render stored content, the renderer needs to know about each plugin so it can turn the stored node back into an <iframe>. Filament's global editor configuration is not inherited by RichContentRenderer, so register the plugins you use on the content explicitly.

The idiomatic way is via the model, using Filament's HasRichContent. Register only the plugins whose embeds your content can contain:

Or render directly:

Twitch only: server-side rendered embeds use the twitch.parent config value for their parent query parameter. Set it to the domain(s) where this content is displayed, otherwise the Twitch player will refuse to load. See Twitch.

Resizing X embeds on the front-end

X (Twitter) post iframes have a fixed height, so taller posts get cropped unless the iframe is resized to its content. In the editor this happens automatically. For your front-end pages, this package ships a tiny (~1 KB) script that listens for the height the X embed reports and resizes each post to fit.

Publish it to your public directory:

Then include it once on pages that display X embeds (e.g. in your layout):

The script is self-initializing and watches for embeds added to the page later, so it works with content loaded dynamically too. It only touches platform.twitter.com iframes; YouTube and Twitch embeds keep their configured dimensions and need nothing.

Sanitization

Filament renders rich content through Str::sanitizeHtml(), whose sanitizer strips <iframe> by default — which would remove every embed. To prevent that, this package extends Filament's application-wide sanitizer config to allow the embed <iframe>, restricting its src to a host allowlist (any other host's iframe src is dropped, leaving a harmless empty iframe). Other media is unaffected.

Each platform contributes its own hosts, and the allowlists are merged into a single sanitizer. You can toggle or customize each one. Publish the config to control it:

AI agents (Laravel Boost)

This package ships Laravel Boost guidelines so AI coding agents know how to use it correctly — adding the toolbar buttons, choosing a storage mode, registering the plugins when displaying content, the Twitch parent requirement and the sanitizer hosts.

If your app uses Laravel Boost, the guidelines are picked up automatically. To pull them in (or refresh them after installing this package), run:

The guidelines live at resources/boost/guidelines/core.blade.php in this package — no configuration is required on your side.

Translations

The package ships with translations (currently en and pt_BR). To customize them in your app, publish the language files:

They will be copied to lang/vendor/filament-rich-editor-extender. Contributions with new locales are welcome.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-rich-editor-extender with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
filament/forms Version ^5.6
illuminate/contracts Version ^13.0
spatie/laravel-package-tools Version ^1.92
symfony/html-sanitizer Version ^8.0
ueberdosis/tiptap-php Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mateuslecchi/filament-rich-editor-extender contains the following files

Loading the files please wait ...