cruddy/ckeditor
CKEditor integration for Laravel, providing a ready-to-use WYSIWYG editor field for Cruddy admin panels. Adds rich text editing to your forms with minimal setup.
This is a single-purpose add-on: it gives the Cruddy admin panel a CKEditor-backed field type so a textarea becomes a WYSIWYG HTML editor. It is a very small package (2 stars, no dependents), so treat the source as the documentation.
composer require cruddy/ckeditor
src/ for a service provider and resources/ for Blade views, JS, and config. If the provider isn't auto-discovered, register it in config/app.php, then:
php artisan vendor:publish --provider="Cruddy\Ckeditor\CkeditorServiceProvider"
(Confirm the exact namespace/provider name from composer.json and src/ — don't assume.)Basic field swap in a Cruddy resource definition. Cruddy resources declare fields declaratively; the package registers a field type you reference there. The pattern is the same as any other Cruddy field:
// Pseudocode — verify the exact key/class against the package source
$this->fields = [
'body' => [
'label' => 'Body',
'type' => 'ckeditor', // or the field class the package exposes
],
];
Store HTML, render deliberately. CKEditor submits HTML, so the column must be text/longText. On the front end you must render it unescaped ({!! $model->body !!}) — which means the trust boundary moves to whoever can edit. If non-admins can edit, sanitize on save (HTMLPurifier or mews/purifier) rather than trusting the client.
Split field configs for different content. A short "summary" field and a long "article body" field rarely want the same toolbar. Configure per-field options (toolbar items, height, allowed content) in the field definition rather than globally, so you don't ship a full toolbar to a caption field.
Uploads. CKEditor's image/link dialogs need an endpoint. Either point the editor's upload config at an existing Laravel upload route you control (with auth + validation + storage disk), or disable uploads entirely and let users paste URLs. Do not let the package's default config, if any, point at a third-party CDN uploader.
Multiple editors per form. Each field instance needs its own unique editor instance. If you render several CKEditor fields on one Cruddy form, verify the package's init code keys off the field id/name; naive document.querySelector('.ckeditor')-style init will only wire the first one.
Livewire / Turbo / SPA-style navigation. If your admin uses Livewire or Turbo, editors must be explicitly destroyed and re-initialized on component teardown/mount. Plan for a small destroy()/init() JS hook; this is the most common integration failure with any CKEditor wrapper.
composer.json and budget time to read the source when something breaks.public/vendor/... or from node_modules, and check that php artisan vendor:publish actually copied the assets after deploy (a classic "works locally, blank editor in prod" cause).CKEDITOR/ClassicEditor global (asset not loaded), check the textarea still exists in the DOM with the expected id, check for a JS error from a previous field's init aborting the rest, and check that your published view override didn't drop the init script.<textarea> is populated with existing content before init.How can I help you explore Laravel packages today?