lexical-editor-image-management

Convert base64 images to stored files and clean up unused media in Lexical Editor.

Updated Feb 23, 2025
One-click install
npx skills add https://github.com/Hieubkav/Ph-ng-Kh-m-Ng-c-Nh-n --skill lexical-editor-image-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lexical-editor-image-management
Source: https://github.com/Hieubkav/Ph-ng-Kh-m-Ng-c-Nh-n/tree/main/.claude/skills/lexical-editor-image-management
Command: npx skills add https://github.com/Hieubkav/Ph-ng-Kh-m-Ng-c-Nh-n --skill lexical-editor-image-management

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automatic handling of embedded editor images: converts base64 images from Lexical Editor into stored files and cleans up unused media to optimize storage.

Core Features & Use Cases

  • Automatic Base64 Conversion: detects, decodes, saves images to storage, and replaces in-content references with public URLs.
  • Smart Cleanup: deletes unused content images when content changes or posts are deleted.
  • Storage Organization: keeps content images in date-based directories for easy maintenance.
  • Robust Observers: end-to-end lifecycle management with error handling, logging, and optional dry-run.

Quick Start

Install the Lexical Editor package, create your model and observer, register the observer in the event service provider, and wire Filament Lexical Editor to enable automatic image management.

Frequently Asked Questions about lexical-editor-image-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert Lexical Editor base64 images to stored files in Laravel?

To convert Lexical Editor base64 images to stored files in Laravel, this Skill uses an Observer-based workflow that scans content, decodes base64 strings, saves them to storage, and replaces inline references with public URLs.

What is the best way to clean up unused images in a Laravel content management system?

The best way to clean up unused images in a Laravel content management system is using an Observer to detect content changes or post deletions, triggering automatic removal of orphaned media files with optional dry-run and logging support.

How does Laravel Observer handle automatic image management for Lexical Editor?

Laravel Observer handles automatic image management for Lexical Editor by hooking into model lifecycle events to scan editor content, organize saved files into date-based directories, and execute cleanup routines for removed images.

Can I use this image management approach with a Filament admin panel?

Yes, you can use this image management approach with a Filament admin panel by wiring the Filament Lexical Editor package into your Laravel application and registering the Observer in the event service provider.

Does the base64 to storage conversion support dry-run and logging?

Yes, the base64 to storage conversion supports dry-run and logging, allowing you to preview unused media cleanup operations and track file replacements without immediately modifying your actual storage infrastructure.