Search by

shamimsofte / laravel-universal-editor

shamimSoftE

Enterprise Laravel integration package for Universal Rich Text Editor

Package info

github.com/shamimSoftE/laravel-universal-editor

pkg:composer/shamimsofte/laravel-universal-editor

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-10-09 13:31 UTC

This package is auto-updated.

Last update: 2026-10-09 13:51:38 UTC


README

Latest Version on Packagist Total Downloads License

An enterprise-grade, secure, and full-featured backend integration package for Universal Rich Text Editor in Laravel.

โœจ Features

  • ๐Ÿ›ก๏ธ Enterprise Security (XSS Sanitizer): Robust HTML sanitization preventing XSS attacks.
  • ๐Ÿ—„๏ธ Document & Version Management: Built-in models and migrations for document history, drafts, and version rollback.
  • ๐Ÿ’ฌ Collaborative Comments & Document Locking: Support for user comments and editing locks to prevent overwrite conflicts.
  • ๐Ÿค– AI Assistant Backend Integration: Dedicated controllers and endpoints for AI-assisted writing tools.
  • ๐Ÿš€ Auto-Discovery: Compatible with Laravel 10, 11, 12, and 13 (PHP 8.1 - 8.4+).

๐Ÿ“ฆ Installation

Install the package via Composer:

composer require shamimsofte/laravel-universal-editor

โš™๏ธ Configuration & Publishing

Publish the configuration file:

php artisan vendor:publish --tag=editor-config

Publish the database migrations:

php artisan vendor:publish --tag=editor-migrations
php artisan migrate

This will publish:

  • config/editor.php: Customizable limits, sanitize rules, AI configurations, and upload paths.
  • Migrations for documents, revisions, comments, and editing locks.

๐Ÿ› ๏ธ Usage

1. Content Sanitization (XSS Safe)

use UniversalEditor\Laravel\Facades\Editor;

// Sanitize user-submitted HTML
$cleanHtml = Editor::sanitize($request->input('content'));

2. Available API Endpoints

The package registers the following routes automatically under /api/editor/:

  • GET|POST /api/editor/documents โ€” Manage documents and drafts
  • GET|POST /api/editor/versions โ€” Document version history and restore
  • POST /api/editor/comments โ€” Inline comment threads
  • POST /api/editor/lock โ€” Real-time editing lock acquisition
  • POST /api/editor/ai โ€” AI writing assistance prompts

๐Ÿงช Testing

Run test suite:

php tests/FullTestSuiteTest.php

๐Ÿ“„ License

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