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

Autocomplete Laravel Package

kerrialnewham/autocomplete

Laravel autocomplete package that makes it easy to add typeahead-style search to your app. Configure searchable model fields, query matching records, and return JSON results ready for any frontend autocomplete widget, with minimal setup and a clean, framework-friendly API.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — primary finding: this is not a Laravel package. kerrialnewham/autocomplete is a Symfony bundle built on Symfony UX / Stimulus. It ships a bundle class registered through the Symfony kernel, Twig templates, Symfony DI service definitions, and Stimulus controllers intended to be wired via Symfony's AssetMapper/Webpack Encore integration. Laravel has no equivalent bundle registration path (no Kernel::registerBundles(), no Twig by default, no Symfony UX bridge). Any Laravel adoption is therefore a port or a partial reuse, not an install.

  • Reusable surface: the Stimulus controller(s) and the request/response contract for the autocomplete endpoint. These are largely framework-agnostic JavaScript and HTTP shape.
  • Non-reusable surface: the bundle class, DI config, Twig form/field rendering, Symfony routing attributes, and any Symfony HttpClient/Serializer usage.
  • Conceptual fit: the server-side-rendered pattern (server owns result markup, client only hydrates) is a legitimate fit for Laravel, but the idiomatic Laravel equivalents are Livewire wire:model.live or a plain JSON endpoint + Alpine. Choosing this package means choosing a non-idiomatic third path.

Integration feasibility. Feasible at roughly 2–4 engineer-days for a thin first slice, assuming the JS controller is cleanly decoupled:

  1. Install @hotwired/stimulus via Vite/npm, register the package's controller, keep the data-controller/data-action attributes.
  2. Stand up a Laravel route + controller (or invokable controller) that returns the HTML fragment or JSON the controller expects.
  3. Replace Twig rendering with Blade partials.
  4. Re-implement config (bundle Configuration tree → config/autocomplete.php) and DI bindings (bundle services.yaml → a service provider).

The blocker is step 1–2 fidelity: without reading the actual controller and endpoint contract we cannot confirm whether the JS is hard-coupled to Symfony-specific URL generation, CSRF tokens, or response envelopes.

Technical risk — high, concentrated in maturity and coupling.

  • Maturity: 6 stars, 0 dependents, last release dated 2026-02-16 (verify this — a future-dated release is either a metadata artifact or a mis-tagged version, both of which warrant a source check before pinning).
  • Bus factor 1: single-author package, MIT, no visible corporate backing. No downstream users means zero community-vetted upgrade paths and no signal on production hardening.
  • Framework drift: Symfony UX / Stimulus is a fast-moving surface; a small package tracking it will lag.
  • Hidden coupling: Symfony bundles frequently assume the full container, event dispatcher, and Twig runtime. Porting cost is unknowable until the source is read.
  • Security surface: autocomplete endpoints are unauthenticated-by-default query surfaces — SQL injection via LIKE construction, XSS via unescaped fragment rendering, and enumeration/data-leak risk if the endpoint returns more than intended.

Key questions to resolve before committing:

  1. Is the Stimulus controller framework-agnostic, or does it depend on Symfony-generated URLs, CSRF tokens, or Turbo?
  2. Does the endpoint return HTML fragments or JSON? Fragments imply server-side escaping guarantees we must replicate in Blade.
  3. What are the PHP and Symfony component version constraints? Do they resolve against our PHP version and Laravel's vendored Illuminate components?
  4. Does the package ship an indexable query builder, or expect the host app to supply the query? (Determines whether we inherit a performance problem.)
  5. What is the license/attribution obligation for a fork, and is the maintainer responsive to issues?
  6. Is the 2026-02-16 release date accurate, and what is the actual changelog cadence?

Integration Approach

Stack fit — the honest assessment is "poor fit, salvageable components." Our stack is Laravel + Blade + Vite + Alpine (assumed). This package targets Symfony + Twig + Stimulus. Overlap is limited to the browser-side controller and the endpoint design. We should treat the package as a reference implementation to port, not a dependency to install.

Three options, in order of recommendation:

  • Option A — Reuse the Stimulus controller only (recommended). Consume the JS via npm/Vite, keep Stimulus as a scoped micro-runtime alongside Alpine. Implement the endpoint natively in Laravel. Lowest surface area, no PHP-side fork to maintain, no Symfony dependency in composer.json. Cost: one controller's worth of adaptation.
  • Option B — Fork and port to a Laravel package. Rewrite bundle registration as a service provider, Twig → Blade, Configuration → config/autocomplete.php, Symfony HttpClient → Laravel Http facade. Gives us a first-class internal package, but we now own a fork with a single upstream author and no dependents. Only justified if we need the feature in ≥2 applications.
  • Option C — Drop it and use Livewire. If the requirement is only "autocomplete with server-rendered results," Livewire delivers the same architecture with a mature, well-supported ecosystem and no cross-framework translation layer. Benchmark this before Option A — it may make the package entirely unnecessary. The package's opportunity score (10.9) suggests a genuinely underserved niche, but niche ≠ necessity when the incumbent is already in our stack.

Migration path (Option A):

  1. Vendor-audit: read the controller and endpoint contract, confirm no Symfony runtime dependency in the JS.
  2. Spike: one search field, one endpoint, measured latency, in a branch.
  3. Generalize: extract a Blade component + a HasAutocomplete trait or query scope.
  4. Retire the Symfony-specific pieces; document the upstream commit we forked from for future diffing.

Compatibility gates:

  • PHP version and Symfony component constraints must not collide with Laravel's Illuminate dependencies (Symfony components are shared; version pinning is a real risk).
  • Stimulus 3.x coexistence with Alpine — both use data-* attributes. Scope Stimulus to a single root element to avoid attribute collision and double-initialization.
  • CSRF: the endpoint must be a GET (read-only, cacheable, no CSRF token needed) or explicitly CSRF-exempted with rate limiting. Do not port a Symfony CSRF assumption blindly.

Sequencing. Do the Livewire benchmark and the controller audit in parallel, in week one. Only proceed to Option A if the audit shows a clean JS contract and the Livewire spike underperforms on a real requirement (e.g., fragment-level caching, or a specific interaction Livewire handles poorly). Otherwise stop — the correct TPM output here is "evaluated and declined," documented.

Operational Impact

Maintenance. Highest ongoing cost in the assessment. A fork means we absorb every upstream change manually with no dependents to validate against and a single-maintainer upstream whose release cadence is unproven. Budget ~10–15% of one engineer's time indefinitely for Option B; near-zero for Option A (a scoped JS controller is cheap to own, and if it rots we replace it in a day). The 6-star, 0-dependent profile means we should assume the package may be abandoned and plan for that as the base case, not the tail risk.

Support. GitHub issues only — no SLA, no commercial backing, no Stack Overflow corpus. Internal escalation path is "read the source." This is acceptable for a thin JS controller and unacceptable for anything in a critical path.

Scaling. Server-side-rendered autocomplete is latency-bound and query-bound, not CPU-bound:

  • Every keystroke is a round trip. Debounce (250–300ms) and a 2-character minimum are mandatory, not optional polish. Without them, a 20-user pilot generates 10–20× the request volume of a JSON/static index approach.
  • The package likely delegates the actual search query to the host app, meaning we own the performance problem. LIKE '%term%' on MySQL will not use a B-tree index and will degrade non-linearly. Plan on a FULLTEXT index, a trigram index, or an external search service (Meilisearch/Scout) from day one — not as a follow-up.
  • Add response caching keyed on normalized query prefix, plus per-user rate limiting.
  • Fragment responses are larger than JSON; at scale, prefer JSON + client render unless the "server-side rendering" property is a hard requirement (it is only strictly required if result markup is complex or must be non-JS-parseable).

Failure modes to design against:

  • Unindexed query → table scan → P99 blowup under concurrent typing. Most likely production failure.
  • Endpoint abuse / enumeration: unauthenticated autocomplete endpoints leak data. Require auth or scope results to the caller's permissions.
  • XSS via fragment rendering: if results echo user-controlled fields, Blade's {{ }} escaping must be preserved — the Symfony/Twig version's escaping guarantees do not transfer.
  • Attribute collision with Alpine causing double-initialized controllers and duplicate requests.
  • Silent degradation on upstream abandonment: no dependents means no CVE/breaking-change signal. Pin to a commit SHA and vendor the controller.
  • Empty-result and error states are typically the least-tested path in small packages; verify them explicitly.

Ramp-up. Low technical ramp-up (small, readable codebase; Stimulus is a ~1-day learn if the team knows Alpine) but two-axis unfamiliarity: the team must reason about both Symfony conventions and Stimulus lifecycle to port correctly. One engineer can own this; it should not be spread across the team.

Recommendation. Do not adopt as a dependency. Run a one-week, time-boxed evaluation: audit the Stimulus controller contract and benchmark Livewire against the same requirement. Default to Livewire or Alpine (native to our stack, mature ecosystem, no cross-framework translation layer). Pursue Option A only if the audit reveals a genuinely reusable, framework-agnostic controller and a requirement Livewire cannot meet — in which case, fork, vendor, pin to a SHA, and treat the upstream as a one-time reference rather than a maintained dependency.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console