- What is marcorieser/statamic-livewire used for?
- It is a Laravel Livewire integration for Statamic that lets you render Livewire components inside Statamic templates. You can build interactive, reactive UIs using Blade or Antlers while keeping content management in Statamic. It helps reduce the need for custom JavaScript frameworks for simple to moderate interactivity.
- How do I install marcorieser/statamic-livewire?
- Install it via Composer with composer require marcorieser/statamic-livewire. The package requires PHP 8.2 or higher, Laravel 11 or higher, and Statamic 5 or higher. Make sure Livewire is installed in your Laravel project if it is not already present.
- Does this package work with Antlers and Blade templates?
- Yes, the package supports both Antlers and Blade templates for Livewire components. You can name a component template counter.antlers.html or counter.blade.php. Antlers users may hit limitations with Blade-specific features such as @stack and @push, so complex components may need Blade.
- What are the requirements for marcorieser/statamic-livewire?
- The requirements are PHP 8.2+, Laravel 11+, and Statamic 5+. You also need Livewire installed in the Laravel application. Install the addon with Composer and follow any upgrade notes for your version.
- How does caching affect Livewire components in Statamic?
- Statamic's aggressive caching can conflict with Livewire's reactive updates if components are cached. Exclude Livewire components from caching or use Statamic's cache:disable directive around them. Test caching behavior early by clearing Statamic's cache and verifying Livewire updates still work.
- How do I include Livewire's frontend assets in Statamic?
- The package documents manual inclusion of Livewire's frontend assets as well as bundling Livewire and Alpine through your asset pipeline. You may need to configure Vite or Laravel Mix so Livewire's JavaScript and CSS load correctly in Statamic. Check the README sections on manually including assets and bundling for details.
- Can I use Livewire components with Statamic multi-site or localization?
- Yes, the package includes support for multi-site and localization scenarios. You can pass initial parameters and use Livewire's localization features within a Statamic multi-site setup. See the README's Multi-Site / Localization section for configuration details.
- What are the alternatives to using Livewire with Statamic?
- Alternatives include Statamic's built-in form handling for simple forms, Alpine.js for lightweight interactivity, or custom JavaScript frameworks like Vue and React. Livewire is most useful when you need server-driven reactivity without adding a heavy JavaScript framework. Evaluate whether your interactivity needs justify Livewire's overhead.
- How do I test Livewire components in a Statamic site?
- You can test Livewire components with Livewire's testing utilities inside your Laravel test suite. Write feature tests that simulate Livewire actions and assert the rendered output. Make sure Statamic content and caching are configured so they do not interfere with Livewire requests during tests.
- Is marcorieser/statamic-livewire actively maintained and compatible with Livewire 3?
- The package targets Laravel 11+, Statamic 5+, and the modern Livewire ecosystem. Review the repository's upgrade guides, such as v4 to v5, and release notes for compatibility details. Maintenance is handled by Marc Rieser and contributors, so check recent commits and issues for active support.