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

Livewire Laravel Package

livewire/livewire

Livewire is a full-stack Laravel framework for building dynamic, reactive UI components using PHP. Create interactive interfaces without writing much JavaScript, with seamless server-driven updates and a component-based approach.

View on GitHub
Deep Wiki
Context7

Livewire is a full-stack Laravel framework for building dynamic, reactive UI components without leaving PHP. It lets you create modern interfaces using familiar Blade + server-side state, while handling updates over AJAX behind the scenes.

Use Livewire when you want rich interactivity with minimal JavaScript and a seamless Laravel developer experience, backed by thorough testing and first-class documentation.

  • Build reactive components using PHP and Blade
  • Automatic DOM updates and server-side state management
  • Works great for forms, tables, modals, and dashboards
  • Strong testing support (unit + browser/ChromeDriver)
  • Clear docs and contribution/security guidelines
Frequently asked questions about Livewire
What Laravel versions does Livewire officially support?
Livewire is fully compatible with Laravel 10+ and PHP 8.1+. The package is designed to integrate natively with Laravel’s core features, including Blade templates and Eloquent models. Always check the [Livewire documentation](https://livewire.laravel.com/docs) for the latest version requirements before upgrading.
How do I install Livewire in an existing Laravel project?
Run `composer require livewire/livewire` to install the package. Then, add `@livewireStyles` and `@livewireScripts` to your `app.blade.php` layout file. Livewire requires no additional configuration for basic usage, though you may need to install ChromeDriver for browser testing (`composer test:browser`).
Can Livewire replace JavaScript frameworks like Vue or React in Laravel?
Livewire is ideal for Laravel apps where you want to avoid heavy JavaScript frameworks. It handles reactivity server-side, reducing client-side complexity while keeping your UI dynamic. However, for highly complex SPAs or decoupled frontend-backend architectures, traditional frameworks may still be preferable.
How does Livewire handle form validation and error messages?
Livewire validates form inputs using Laravel’s built-in validation rules. Errors are automatically displayed in Blade templates using `$errors` helper, similar to traditional Laravel forms. You can also customize validation logic in your component’s `rules()` method or use `validate()` for manual checks.
Does Livewire work with Laravel’s authentication system?
Yes, Livewire integrates seamlessly with Laravel’s authentication. Middleware like `auth` or `guest` works as expected, and Livewire components respect these restrictions. For example, a `wire:model` bound to a protected property will only update for authenticated users.
What are the performance implications of using Livewire for high-traffic apps?
Livewire sends HTTP requests for state updates, which can introduce latency under high concurrency. Mitigate this by debouncing `wire:model` (e.g., `wire:model.debounce.500ms`), lazy-loading components, or caching frequent component states. Test under load to identify bottlenecks.
How do I secure sensitive data in Livewire components?
Use Laravel’s built-in security features like `#[Locked]` attributes to prevent public property tampering. For sensitive data (e.g., tokens, PII), bind to Eloquent models or private properties. Avoid exposing sensitive logic in public methods or properties accessible via the wire protocol.
Can I use Livewire with Laravel’s Vite or Mix for asset compilation?
Yes, Livewire works with both Vite and Laravel Mix. Ensure your `vite.config.js` or `webpack.mix.js` includes Livewire’s JS dependencies. Livewire’s assets are automatically compiled, but you may need to adjust your build process if using custom configurations.
Are there alternatives to Livewire for Laravel real-time UIs?
Alternatives include Laravel Echo + Pusher for event-driven updates, Inertia.js for React/Vue integration, or Alpine.js for lightweight interactivity. Livewire stands out for its PHP-first approach, eliminating the need for complex frontend tooling while maintaining Laravel’s ecosystem compatibility.
How do I test Livewire components in Laravel?
Livewire provides built-in browser testing using ChromeDriver (`composer test:browser`). For unit tests, mock components with `Livewire::test()`. Use `wire:model` assertions to verify state changes. Check the [Livewire testing docs](https://livewire.laravel.com/docs/testing) for advanced scenarios like CSP environments.
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.
phpyh/coding-standard
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