Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Summernote Bundle Laravel Package

toinou/summernote-bundle

A Symfony bundle for integrating the Summernote WYSIWYG editor into your applications, providing a convenient way to add rich-text HTML editing and bundle configuration to Symfony projects.

View on GitHub
Deep Wiki
Context7

Getting Started

Treat this as a thin, unmaintained asset/form glue bundle rather than a full editor platform. The README on the repo is the only reliable source of truth for class names and config keys — read it before anything else, because the package has no dependents and no downstream examples to crib from.

  1. Install and register. Symfony 3 bundles are not auto-discovered.
composer require toinou/summernote-bundle
// app/AppKernel.php
$bundles = [
    // ...
    new Toinou\SummernoteBundle\SummernoteBundle(),
];
  1. Verify the namespace is real. Before writing any code, confirm the actual namespace and directory layout:
ls vendor/toinou/summernote-bundle
grep -r "namespace" vendor/toinou/summernote-bundle --include=*.php | head
cat vendor/toinou/summernote-bundle/README.md
  1. Find the two integration points. Almost every Symfony editor bundle exposes exactly one of these, often both:

    • a form type (something like SummernoteType) that renders a <textarea> plus the JS init;
    • a Twig form theme / macro that decorates an existing textarea widget.
  2. First use case. Take an existing text/textarea field (a CMS Body or a Post::content), swap the widget for the bundle's type, and confirm the editor loads. That single change is the whole value proposition of the bundle — everything else (uploads, sanitization, custom toolbars) is work you own.

If the bundle exposes nothing usable beyond a CDN <script> tag, stop and vendor Summernote directly via Encore; you will save time.

Implementation Patterns

Form-type substitution. The intended workflow is a drop-in widget swap, keeping your entity and validator untouched:

$builder->add('content', SummernoteType::class, [
    'required' => false,
    'attr' => ['rows' => 12],
]);

Keep the data contract boring. Summernote submits HTML. Store it in a TEXT/LONGTEXT column, never in a VARCHAR(255), and do not add a strip_tags constraint — it will silently mangle legitimate markup. Instead put sanitization in a listener or a setter so the DB always holds clean HTML:

public function setContent(?string $html): self
{
    $this->content = $this->purifier->purify((string) $html); // e.g. ezyang/htmlpurifier
    return $this;
}

Rendering side. {{ post.content|raw }} is required, which makes server-side purification non-optional. Do it on write, not on read, so cached templates and API consumers all get the same safe output.

Asset wiring. Symfony 3-era bundles usually assume Assetic and jQuery already loaded. If you are on Webpack Encore, ignore the bundle's asset helper entirely and load Summernote yourself:

require('summernote/dist/summernote-bundle.css');
require('summernote');
$('.summernote').summernote({ height: 300, toolbar: [['style', ['bold', 'italic']], ['insert', ['link', 'picture']]] });

Uploads. If you enable insertImage with a custom onImageUpload, point it at your own controller with a CSRF token and a mime/size whitelist. Never trust the bundle's default handler path if one exists — it predates modern upload hardening.

Config. Any bundle config lives under toinou_summernote: (verify the key with app/console config:dump-reference summernote). Keep only global defaults there — toolbar variants belong in the template/JS, where editors differ per screen.

Gotchas and Tips

  • Symfony 3 is EOL (Nov 2018). This bundle is a Symfony 3 artifact: expect AppKernel, Resources/views, and possibly Assetic idioms. It will not install cleanly on Symfony 5/6 without a fork.
  • Zero dependents and a low score mean no battle-testing. Budget for reading the source. Check the bundle's DependencyInjection/Configuration.php and Resources/config/services.yml first — they tell you the real public surface faster than the README.
  • jQuery ordering. Summernote requires jQuery to be global before the plugin script. In Encore, use ProvidePlugin({ $: 'jquery', jQuery: 'jquery' }), or you get the classic summernote is not a function.
  • Bootstrap version mismatch. Summernote's summernote-bs4 vs default builds differ in popover styling; a BS3 bundle skin on a BS4 page produces invisible dropdowns. Match the build to your theme.
  • Duplicate initialization. Turbo/Turbolinks-style navigation or re-rendered forms will double-init the editor. Guard with if (!$el.next('.note-editor').length) or destroy on teardown.
  • Forms and validation. Summernote empties the real <textarea> state in some versions; assert the hidden field value in tests rather than the visible editor DOM.
  • Debugging steps: app/console debug:container --tag=form.type | grep -i summernote to confirm the form type is registered, and app/console debug:twig to find the form theme path. If the editor renders unstyled, the CSS never loaded — check the network tab before touching PHP.
  • Extension points are limited to form theme override (copy the bundle template into app/Resources/views/Form/) and JS options passed via attr. Anything more invasive means forking.
  • Verdict for day-to-day use: fine as a five-minute widget swap on a legacy Symfony 3 app you already maintain. For new work, skip it — wire Summernote or a maintained editor directly and keep the dependency count at zero.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
muka/shape-reader
tdt/json
refinery29/php-cs-fixer-config
hotmeteor/eco-env
mvaliolahi/hydrate
wearede/tbcpay-php
parsnick/steak
thibaud-dauce/mattermost-php
multilinguals/apollo-client
antaresbr/collection
kr0lik/phpstan-rules
loco/loco
starfederation/datastar-php
yupmin/modern-phystrix
stephenjude/extended-artisan-commands
lumphp/laravel-macroable
lumphp/laravel-collections
lumphp/laravel-contracts
sermepa/sermepa
arkecosystem/fortify