Weave Code
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

Stimulus Bundle Laravel Package

symfony/stimulus-bundle

Symfony bundle that integrates Hotwired Stimulus into your app, wiring up controllers, auto-loading, and UX bridges with Symfony tooling. Ideal for adding modest JavaScript behavior to Twig and Symfony UX components without a heavy frontend setup.

Deep Wiki
Context7

Getting Started

This package is Symfony-specific and cannot be used in Laravel. For Laravel projects requiring Stimulus integration, avoid this bundle entirely—instead, install Stimulus manually via npm/yarn (e.g., npm install stimulus) and configure it within Laravel Mix or AssetMapper. Start with a minimal resources/js/controllers/index.js that imports Stimulus and registers controllers from resources/js/controllers/. Use Blade directives to include compiled JS/CSS via mix() or asset(). No Composer package or Symfony-style auto-registration is needed—just follow standard Laravel frontend conventions.

Implementation Patterns

In Laravel, manage Stimulus controllers as standard NPM modules under resources/js/controllers/, exporting default classes that extend Stimulus.Controller. Register them explicitly in index.js (e.g., application.register('hello', HelloController)). Wire behavior using Blade’s @props, {{ }}, or Blade directives to inject data-* attributes into HTML (e.g., <div data-controller="hello" data-hello-target="name">). Use data-action and data-target as usual. For reusable logic, create shared controller base classes or use helper modules (e.g., mixins/toggle.js). When integrating with Laravel Form components, extend form macros to inject data-controller attributes via attributes->merge().

Gotchas and Tips

Do not confuse this bundle with Laravel-native solutions—there is no Symfony-style stimulus.json manifest in Laravel. Manual controller registration is required; Stimulus won’t auto-discover files unless you use a bundler plugin like stimulus-fetch or custom Webpack glob imports. Ensure your webpack.mix.js (or Vite config) includes Stimulus polyfills and exports correctly. Common pitfalls: forgetting to npm run build after adding new controllers, case mismatches in controller names (e.g., HelloController vs hello_controller), and missing application.stimulus.js registration in Blade. Debug using browser console warnings for unregistered controllers and verify mix-manifest.json includes your JS entrypoint. For performance, consider lazy-loading controllers using dynamic import() and application.load() with URL-based activation.

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport