- How do I install lianmaymesi/livewire-phone in a Laravel app?
- Install it with Composer using composer require lianmaymesi/livewire-phone. Then follow the README to publish any config or assets and add the Livewire component to your form. Because the package wraps intl-tel-input, make sure its JavaScript and CSS are available in your build. Check the repository README for the exact component tag and any required setup steps.
- Does livewire-phone support Laravel 10, Laravel 11, and Livewire 3?
- The package is built for Laravel applications that use Livewire, but exact version constraints are defined in its composer.json. Check the package page on Packagist or the GitHub repository before installing to confirm compatibility with your Laravel and Livewire versions. If you are on an older Laravel release, verify that the required Livewire version is still supported.
- How do I validate a phone number with this Livewire phone input?
- Use Livewire's normal validation flow in your component and add rules for the bound phone property. The package is intended to provide phone validation support on top of intl-tel-input, so confirm the exact rule or validation hook in the README. Always keep server-side validation in place because client-side formatting and checks can be bypassed.
- Does it detect the visitor's country automatically?
- intl-tel-input supports initial country detection, and the Livewire component may expose options for it. Whether automatic detection is enabled by default depends on the package's component props and configuration. Review the README for initialCountry, geoIpLookup, or similar settings, and provide a sensible default country for users when detection is unavailable.
- Can I customize the country list, preferred countries, and phone format?
- Country list, preferred countries, and formatting are typically configured through the underlying intl-tel-input options or the package's config and component props. Check the README for the supported option names before assuming a setting is exposed. If an option is not surfaced, you may need to extend the component or use intl-tel-input directly.
- Does livewire-phone work with wire:model and Livewire form validation?
- It is designed as a Livewire component, so you should bind it to a public property with wire:model and validate that property in your Livewire component. Confirm the expected property name and any update or debounce behavior in the README. Keep validation rules on the server side so the value is checked even when JavaScript is disabled.
- Do I need to install intl-tel-input assets separately?
- Because the package is built on intl-tel-input, its JavaScript and CSS must be loaded for formatting and country selection to work. Some Livewire wrappers inject assets automatically, while others expect you to import them through Vite or npm. Follow the installation instructions in the README and verify the assets load in the browser.
- How do I test a Livewire component that uses livewire-phone?
- Use Livewire's testing helpers to mount the component, set the phone property, and assert your validation rules and database behavior. PHP tests do not execute intl-tel-input's browser JavaScript, so focus on server-side validation, property binding, and rendered output. For JavaScript behavior, add a browser test with a tool such as Pest Browser or Dusk.
- What are good alternatives to lianmaymesi/livewire-phone?
- For Laravel-only validation and formatting, propaganistas/laravel-phone is a common choice. For a Livewire UI similar to this package, you can also build a custom component around intl-tel-input or use another Livewire phone input package. Choose based on whether you need client-side country selection, server-side validation, or both.
- Is lianmaymesi/livewire-phone maintained and safe for production?
- Check the GitHub repository for recent commits, releases, open issues, and response times before using it in production. Pin a specific version in composer.json and keep server-side phone validation as the source of truth. If the package appears inactive, consider wrapping intl-tel-input yourself or using a more actively maintained alternative.