Skip to main content

CKEditor

super-admin-org/ckeditor adds a ckeditor rich-text field to forms. Image and link dialogs can pick files from the Media Manager.

Packagesuper-admin-org/ckeditor
Adds$form->ckeditor('column')
EditorCKEditor 4 (from the ckeditor/ckeditor Composer package)
CKEditor 4 licensing and end of life

CKEditor 4 reached end of life in June 2023. Versions 4.23 and newer, which this package installs (ckeditor/ckeditor ^4.25), are CKEditor 4 LTS, available only under a commercial licence, with security updates until December 2026. Versions up to 4.22 are open source but have known security issues.

If you do not hold a CKEditor 4 LTS licence, do not use this extension in production. A replacement editor is being evaluated.

Installation​

composer require super-admin-org/ckeditor
php artisan vendor:publish --tag=super-admin-ckeditor --force

The publish step copies the editor to public/vendor/super-admin-org/ckeditor. Without it every admin page logs a 404 for ckeditor.js.

Usage​

$form->ckeditor('content');

// Field options are passed to CKEDITOR.replace()
$form->ckeditor('content')->options(['height' => 400, 'language' => 'en']);

The value is saved as HTML. Escape or sanitise it before showing it to other users if editors are not fully trusted.

Configuration​

Global editor options for every field:

'extensions' => [
'ckeditor' => [
'enable' => true,
'config' => [
'height' => 300,
'extraAllowedContent' => 'iframe[*]',
'filebrowserImageUploadUrl' => '/image/upload',
],
],
],

The Browse server buttons open /admin/media in a pop-up. They need the Media Manager extension and the default admin route prefix.

Compatibility​

LaravelPHPState
8 – 138.0+Works, subject to the licensing note above.

Known limitation: the editor script is loaded on every admin page, not only on pages with a CKEditor field.