super-admin-org / ckeditor
Integrate CKEDITOR into super-admin
Requires
- php: >=7.0.0
- ckeditor/ckeditor: ^4.25
- laravel/framework: >=7.0
- super-admin-org/super-admin: ^1.0
Requires (Dev)
- laravel/laravel: >=7.0
- phpunit/phpunit: >=6.0
README
CKEditor Extension for Super Admin
A powerful Super Admin extension that seamlessly integrates the CKEditor 4 WYSIWYG editor into your admin panel forms. Replace plain textareas with a full-featured rich text editor — complete with formatting tools, image uploads, link management, and media browser integration.
Screenshot
Features
- Rich Text Editing — Full WYSIWYG editor with bold, italic, lists, headings, tables, and more
- Media Browser Integration — Browse and insert images directly from Super Admin's built-in media manager
- Link Management — Insert and edit links with a user-friendly dialog
- Global & Per-Field Configuration — Set defaults globally or customize each editor instance
- Multi-Language Support — Configure the editor UI in any supported language
- Custom Styling — Apply your own CSS to match the editor content with your frontend design
- Auto-Discovery — Works out of the box with Laravel's package auto-discovery
- Secure — Ships with CKEditor 4.25+, patched against known XSS vulnerabilities
Requirements
- PHP >= 7.0
- Laravel >= 7.0
- Super Admin >= 1.0
Installation
Step 1: Install the package via Composer:
composer require super-admin-org/ckeditor
Step 2: Publish the CKEditor assets:
php artisan vendor:publish --tag=super-admin-ckeditor
That's it! The service provider is auto-discovered by Laravel.
Configuration
Add your editor settings in the extensions section of config/admin.php:
'extensions' => [ 'ckeditor' => [ // Set to false to disable this extension 'enable' => true, // Global editor configuration 'config' => [ 'language' => 'en', 'height' => 500, ] ] ]
Available Configuration Options
| Option | Type | Description |
|---|---|---|
enable |
bool |
Enable or disable the extension |
config.language |
string |
Editor UI language ('en', 'de', 'fr', 'es', etc.) |
config.height |
int |
Editor height in pixels |
config.contentsCss |
string |
Path to custom CSS applied inside the editor |
For all available CKEditor options, see the CKEditor 4 Documentation.
Usage
Basic Usage
Add a CKEditor field to any Super Admin form:
$form->ckeditor('content');
With Custom Options
Override global config on a per-field basis using the options() method:
$form->ckeditor('content')->options([ 'lang' => 'fr', 'height' => 500, ]);
With Custom Content Styling
Match the editor's content area with your frontend styles:
$form->ckeditor('content')->options([ 'contentsCss' => '/css/frontend-body-content.css', ]);
Full Form Example
Here's a complete example of a blog post form with a CKEditor field:
protected function form() { $form = new Form(new Post()); $form->text('title', 'Title')->required(); $form->text('slug', 'Slug')->required(); $form->image('thumbnail', 'Thumbnail'); $form->ckeditor('body', 'Content')->options([ 'height' => 600, ]); $form->select('status', 'Status')->options([ 'draft' => 'Draft', 'published' => 'Published', ]); $form->datetime('published_at', 'Publish Date'); return $form; }
Image & Media Browser
The extension integrates with Super Admin's media manager out of the box. When inserting an image or link in the editor, users can browse and select files from the media library — no extra configuration needed.
Troubleshooting
CKEditor not showing up
If the editor doesn't appear after installation, clear Laravel's compiled services and cached packages:
php artisan optimize:clear
Then re-publish the assets:
php artisan vendor:publish --tag=super-admin-ckeditor --force
Assets not loading
Make sure your web server can serve files from the public/vendor/ directory. After publishing, the CKEditor files should be located at:
public/vendor/super-admin-org/ckeditor/
Updating
To update the package and its CKEditor assets:
composer update super-admin-org/ckeditor php artisan vendor:publish --tag=super-admin-ckeditor --force
License
Licensed under The MIT License (MIT).
