turbo-php/livewire-phone-input
A Livewire phone input component for Laravel that adds country code selection, phone number formatting, and validation to forms. It simplifies collecting international phone numbers in Livewire apps with a reusable, user-friendly field that integrates cleanly with your existing validation rules.
Architecture fit. turbophp/livewire-phone-input is a Livewire component package: a Blade view plus a PHP config that exposes a classes map, letting a consuming app restyle the input entirely through configuration rather than by forking or overriding views. That is a good architectural fit for Laravel/Livewire teams that want a phone input without owning a component. The cost is that the package's presentation layer is now a de facto part of our configuration surface — styling correctness depends on our build toolchain and our config file, not just on the package's code.
Integration feasibility. High. Composer install, publish, wire into a form, done. The traps disclosed in v1.0.1 are the real integration cost, and all three are consumer-side rather than package-side:
config/. Class names we place in config/phone-input.php are invisible to the Tailwind scanner and get stripped from the production build unless we add an explicit @source directive. This is the highest-severity item: it fails silently, works in dev (where JIT may already have the utilities from other templates), and breaks in a production build.config/phone-input.php will not pick up keys added in later versions. Because the published config is where our classes live, this converts every future minor release into a manual three-way merge.Technical risk. Low-to-moderate, and mostly our risk rather than the package's. v1.0.1 is documentation only with no code delta, so adoption risk for this specific release is effectively zero. The residual risks are: (a) silent CSS stripping discovered only at build/pre-deploy; (b) config drift accumulating across versions because the published file is a snapshot; (c) styling knowledge concentrated in whoever read the changelog. There is no evidence of API churn, and no breaking changes are signalled.
Key questions.
@source for config/, or will we be adding the first one? Who owns that line?important.Stack fit. Requires Laravel with Livewire and a Tailwind build. Teams not on Tailwind can still use the package but lose the entire classes story, which is the reason to choose it — for a non-Tailwind stack, evaluate whether a plainer input component is a better fit before committing.
Migration path. Additive only. Install, publish config and view, register the @source path, add the component to one low-traffic form first. No schema, no data migration, no existing-form rewrite required. Where an existing phone input is in place, run both behind a feature flag for one release cycle to compare validation and formatting behaviour before removing the incumbent.
Compatibility.
@source requirement is the compatibility gate. Confirm which Tailwind version is in use and that the directive form matches it; a version mismatch here reproduces the exact silent-stripping failure the release notes warn about.Sequencing.
@source, build for production (not dev) and verify the configured classes survive minification.Maintenance. Low code maintenance, non-trivial config maintenance. Every future release that adds config keys requires a deliberate merge into our published file; skipping it produces a component that silently ignores new features. Budget a small, recurring task per upgrade rather than assuming patch releases are free.
Support. The three traps are the anticipated support load: "styles missing in production" (Tailwind scan), "my variant doesn't apply" (emit-order tie), and "the new option does nothing" (pinned config). Pre-empt all three with internal documentation now — each is far cheaper to write than to debug from a production symptom. That this had to be documented in a patch release also suggests the package's docs are still maturing; expect further guidance to arrive via changelog rather than docs site, and subscribe accordingly.
Scaling. Fine for typical form counts. Watch two things as usage grows: the size of the classes map (every configured utility is real CSS, and a wide variant matrix multiplies it), and consistency — if several teams each publish their own config, styling diverges. Prefer a single shared config or a thin internal wrapper component.
Failure modes.
Ramp-up. Under a day for a developer familiar with Livewire and Tailwind, provided the @source step and the three traps are handed over explicitly. Without that handover, expect half a day lost to the production-build stripping issue alone, plus recurring confusion on variant precedence. Keep the ramp-up note attached to the component's location in the repo rather than in a wiki.
How can I help you explore Laravel packages today?