Weave 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 Phone Input Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • Tailwind does not scan 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.
  • Variant/base property ties are resolved by CSS emit order, not authoring order. A state variant that sets the same property as its base part will not reliably win, regardless of how the config reads. Mitigation is to mark such variants important — a non-obvious convention that must be documented in our own code.
  • Publishing pins the config. A published 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.

  • Does our Tailwind setup already include a @source for config/, or will we be adding the first one? Who owns that line?
  • Is the published config committed to the repo, and do we have a diff-on-upgrade step in our dependency-bump checklist?
  • How many variants in our intended design set the same CSS property as their base part? Those are the ones needing important.
  • Is the phone input on a critical path (signup, 2FA, checkout) where a stripped class becomes an incident rather than a cosmetic bug?

Integration Approach

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.

  • Tailwind: the @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.
  • Livewire: pin to the Livewire major the package declares, and confirm on the first form that validation and wire:model round-trips behave.
  • Config: treat the published file as ours to maintain, not as the package's. Track upstream default keys per version.

Sequencing.

  1. Spike: install on a branch, publish, add @source, build for production (not dev) and verify the configured classes survive minification.
  2. Codify the three traps as short internal notes next to the component and in the config file's header comment.
  3. Ship to one internal form; validate a production build in CI, not just locally.
  4. Roll out to remaining forms; add the config-diff step to the dependency-upgrade runbook before the next version bump lands.

Operational Impact

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.

  • Silent CSS stripping at production build — highest impact, invisible in dev. Detect with a production-build assertion in CI.
  • Variant tie — cosmetic-to-functional depending on which property loses; likely to surface as inconsistent focus/error styling rather than a hard break.
  • Config drift on upgrade — degrades gradually; new options are inert until someone notices.
  • View override staleness — if the view is published and later versions change it, our copy silently diverges. Prefer not publishing the view unless we genuinely need structural changes.

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.

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.
encore2/laravel-admin2
cboxdk/laravel-console-kit
shapecode/doctrine-dbal-datetimeutc
gilads-otiannoh254/inertia-protocol
dakiquang/laravel-oauth-refresh-lock
woda/laravel-worktrees
dalefranks/ramasite
faghy/laracashbook
roundly-consulting/google-places-for-laravel
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
adachsoft/cli-process-tester
adachsoft/changelog-linter
adachsoft/collection
adachsoft/php-code-style
adachsoft/api-version-bundle
cgv/localized-resource