- What is Airwire and how does it work with Laravel Livewire?
- Airwire is a lightweight Laravel package that connects Alpine.js with Livewire. It provides a small JavaScript API so Alpine components can call Livewire actions and read Livewire properties directly, without custom glue code. Livewire still handles server-side logic and validation.
- How do I install Airwire in a Laravel application?
- Install Airwire via Composer using composer require archtechx/airwire. The package is auto-discovered in Laravel, so no manual service provider registration is required. No asset build changes are needed; it works with your existing Livewire and Alpine setup.
- Which Laravel and Livewire versions does Airwire support?
- Check the composer.json in the repository for the exact version constraints. Airwire is built for Laravel applications using Livewire and Alpine.js. As a lightweight bridge, it generally tracks Livewire releases, but verify compatibility with your Laravel major before production use.
- How do I call a Livewire action from an Alpine event handler using Airwire?
- Airwire exposes Livewire actions to Alpine so you can invoke them directly from event handlers like x-on:click. You write the call in your Alpine expression, and Airwire routes it to the correct Livewire component method. This keeps your markup declarative and avoids writing custom event listeners.
- How does Airwire keep Alpine and Livewire state in sync?
- Airwire gives Alpine reactive access to Livewire properties. When Livewire state changes, Alpine components can read and react to those properties. The package handles synchronization with minimal boilerplate, so Livewire remains the source of truth while Alpine manages client-side interactivity.
- Do I need to change my asset build or frontend stack to use Airwire?
- No. Airwire is a drop-in integration that works with your existing Livewire and Alpine setup. It does not require changes to your asset build or frontend stack. You install it via Composer and start using the JavaScript API in your Alpine components.
- Can I use Airwire with existing Livewire components?
- Yes. Airwire is designed as a drop-in integration for existing Livewire components. You do not need to rewrite your components. It adds a bridge so Alpine can call Livewire actions and read Livewire state, making it easy to incrementally add Alpine interactivity to an existing Livewire application.
- Is Airwire suitable for production Laravel applications?
- Airwire is lightweight and focuses on a narrow integration surface, which reduces risk. However, you should evaluate it against your application's requirements and test it in a staging environment. Check the release history and maintenance activity, pin the version, and ensure your Livewire and Alpine versions are compatible.
- How does Airwire compare to Livewire's built-in Alpine integration or writing custom JavaScript?
- Livewire already offers some Alpine integration, but Airwire provides a more direct bridge for calling actions and reading state from Alpine. It reduces the custom JavaScript glue you would otherwise write. If your needs are simple, Livewire's built-in features may suffice; Airwire is useful when you want tighter declarative integration.
- How is Airwire maintained and where can I report issues?
- Airwire is maintained by ArchTech and is open source on GitHub. You can report issues or contribute via the repository at github.com/archtechx/airwire. Check the repository for release notes, license, and contribution guidelines, and review maintenance activity before adopting it.