lifo/typeahead-bundle
Symfony bundle that integrates Twitter Typeahead.js into forms and templates, adding AJAX-powered autocomplete and suggestion fields with minimal configuration. Provides helpers for connecting typeahead inputs to controllers and data sources.
Architecture fit — poor. This is a Symfony2 bundle, not a Laravel package. It is built around the Symfony Form component (AbstractType, OptionsResolver), Symfony's DI container, and Twig form themes. Laravel has none of these: its form layer is Blade + requests, and its container/service-provider semantics are not bundle-compatible. Nothing in this package can be composer required into a Laravel application and used idiomatically. The realistic fit is zero as a dependency and moderate as a reference design for an autocomplete widget.
What it actually does. It registers a form type that renders a Bootstrap 3 typeahead input backed by a remote JSON endpoint, with options for the data source URL, display/value keys, and minimum query length. That is roughly 100–200 lines of glue between an HTML input, an AJAX endpoint, and a JS library. The value is in the option/API shape, not in any non-obvious engineering.
Integration feasibility — near-blocked.
symfony/form to the 2.x line. Modern Laravel (9/10/11) ships Symfony 6/7 components, so dependency resolution will almost certainly fail. Installing it would require --ignore-platform-reqs and a parallel Symfony 2 tree — not a viable production posture.each(), dynamic properties, old DI APIs) are likely friction points. Verify against your target PHP before assuming even a fork is cheap.typeahead.js are both end-of-life and jQuery-dependent. Laravel's default front-end (Vite + Tailwind, or Bootstrap 5) has no place for these assets without a parallel legacy CSS/JS island.Technical risk — high.
typeahead.js is unmaintained, so any XSS or rendering bug in its templating path is yours permanently.Key questions for the requester
Stack fit. Treat this as a specification to reimplement, not a component to install. The portable artifacts are the option contract (source URL, displayKey/valueKey, min length, debounce) and the JSON response shape [{value, label}]. Everything else — form type, Twig theme, service wiring — is Symfony-specific and should be discarded.
Recommended target mapping (Laravel):
| Bundle concern | Laravel equivalent |
|---|---|
| Symfony form type | Blade component / <x-typeahead> or Livewire component |
| Twig form theme | Blade partial + @vite asset entry |
| Controller JSON action | Route + invokable controller returning JsonResponse, or Scout/whereLike query |
| Bootstrap 3 + typeahead.js | Tom Select, Choices.js, or Alpine + fetch (all maintained, accessible) |
| Symfony DI config | Service provider only if you build a shared package |
Migration path.
vendor/laravel-typeahead) with a config file and a published Blade view — this is the durable version of what the bundle was trying to be.Compatibility. Assume no compatibility with your current PHP/Symfony constraints until proven otherwise by reading composer.json; the install attempt is likely to fail outright. Front-end compatibility is the harder blocker: shipping Bootstrap 3 CSS alongside Bootstrap 5 or Tailwind causes selector collisions and unpredictable cascade behavior.
Sequencing.
innerHTML on remote data).Maintenance. Upstream is dormant. There is no path to upstream fixes, no release cadence, and no maintainer to escalate to. Adopting it means owning a vendored fork indefinitely, including any jQuery/CSS security findings — a permanent tax for a widget you could own outright in a few days.
Support. No vendor, no SLA, no CVE process, and a single maintainer with a 2018 last release. Internal support falls entirely on the adopting team. For a UI convenience feature, that is a poor risk-to-value trade.
Scaling. The architecture puts load on your application tier: every keystroke beyond the minimum length issues a JSON request. At scale, plan for debounce (200–300 ms), a minimum query length, request cancellation, per-user rate limiting, and an indexed search backend (Scout with Meilisearch/Typesense, or a LIKE-with-index fallback) rather than an unindexed table scan. Caching popular prefixes helps but adds invalidation work. None of this is provided by the bundle — you build it either way.
Failure modes to plan for.
Ramp-up. Rebuilding natively is a low ramp for any Laravel developer familiar with Blade and a modern select library (~1 day to first working version, 1–3 days to production quality with tests and a11y). Porting the bundle itself is a high ramp for near-zero payoff — days of Symfony 2 archaeology plus ongoing fork ownership.
Recommendation. Reject as a dependency; score 1.17 is consistent with that. Preserve the option/response contract as a design reference, implement natively in Laravel, and spend the saved effort on the search backend and accessibility.
How can I help you explore Laravel packages today?