tudortibu/select2entity-bundle
A Symfony bundle that provides a Select2Entity form type, enabling AJAX-powered Select2 entity selection in forms. It supports autocomplete-style Doctrine entity lookup and configurable remote endpoints for smoother form integration.
Stack mismatch is the headline finding. Despite being filed under "Laravel/PHP package," tudortibu/select2entity-bundle is a Symfony2 bundle, not a Laravel package. It depends on the Symfony full-stack framework's Form component, Twig, the DI container, and bundle registration in AppKernel. It will not install or boot inside a Laravel application without a rewrite. Any evaluation framed as "adopt this in our Laravel stack" should be reframed as "adopt the pattern this bundle encodes."
Architecture fit. Low for Laravel, moderate for a legacy Symfony 2.x app. The bundle's actual value proposition is narrow and well-understood: it replaces a <select> populated with every entity row with a Select2 AJAX-backed autocomplete that queries an endpoint and returns {id, text} JSON. That pattern is framework-agnostic and trivially reproducible with a Laravel route, a controller, a Blade component, and ~40 lines of JavaScript. The bundle itself is a convenience wrapper, not a capability.
Integration feasibility. Effectively zero as a Composer dependency on a modern Laravel stack. Expect composer.json constraints pinned to symfony/symfony: ~2.x and php: >=5.3.9, which will conflict with Laravel 8–11's PHP 8.x requirements. Forcing an install via --ignore-platform-reqs buys you a bundle that registers services into a kernel that doesn't exist. The feasible path is a pattern port: a GET /api/{resource}/search?q= endpoint returning paginated {results: [{id, text}]}, a Blade partial with data-search-url, and a thin JS initializer.
Technical risk. High, and concentrated in abandonment. Symfony 2 reached end-of-life in 2018; the bundle has 0 stars, 0 dependents, a single author, and no visible test suite or CI. There is no downstream usage to validate it against, no security triage, and no upgrade path. Adopting the code means owning the code. The one mitigating factor is that the domain surface is tiny — the whole thing is a form type plus a JS glue file — so the blast radius of a rewrite is small and the risk is mostly time, not correctness.
Key questions for the requestor.
Stack fit. For Laravel 10/11, the correct move is a native reimplementation, and the bundle serves as a specification document rather than a dependency. Concretely: a reusable Searchable interface plus trait on Eloquent models (declaring searchColumns() and toSearchResult()), a single EntitySearchController@__invoke that resolves the model from a signed/whitelisted route parameter, and a <x-entity-select> Blade component that emits the data-* attributes and a namespaced JS module.
Migration path. If a legacy Symfony 2 app genuinely exists, run the bundle in place behind that app's boundary and treat it as frozen — no version bumps, no shared code. In parallel, extract the behavioral contract (query parameter name, minimum input length, debounce interval, response envelope, pagination shape, empty-state text) and write it down. That contract is the only durable artifact here; it lets the Laravel and Symfony sides behave identically during a transition and lets you swap the JS library later without a UX regression.
Compatibility. Two distinct compatibility problems. First, PHP/Composer: the bundle's platform constraints will not resolve alongside Laravel, full stop. Second, front-end: Select2 v3 and v4 differ in markup and event names, Select2 requires jQuery, and jQuery-era plugins carry a maintenance tail that most Laravel teams have deliberately shed. For new builds, evaluate Tom Select or the native <datalist>/combobox pattern before defaulting to Select2.
Sequencing.
Estimated effort for steps 2–5 is 2–4 developer-days for a mid-level Laravel engineer — small enough that the "reuse the package" framing has no economic justification.
Maintenance. As a dependency: unmaintainable. Zero stars and zero dependents means no one else is exercising the code path, so the first production bug is yours alone to diagnose and patch, on a framework version that has been EOL for years. As a one-time pattern reference: negligible, because nothing is added to the dependency graph. The maintenance burden shifts to your own small controller and component, which is exactly where you want it — versioned, tested, and owned by the team that understands it.
Support. No vendor, no community, no issue triage, no security advisories. Escalation path is "read the source and fix it." Acceptable only if the team has explicitly accepted ownership, which for a 40-line form type is a reasonable trade; for anything deeper it is not.
Scaling. The bundle's design implies one HTTP request per debounced keystroke, which is the real operational risk regardless of framework. Unmitigated, this produces LIKE '%term%' scans on unindexed columns, connection-pool pressure proportional to active form users, and a database that degrades non-linearly as the entity table grows. Mitigations are non-negotiable: minimum query length of 2–3 characters, 250–300ms debounce, server-side result caps, prefix or full-text indexes rather than leading-wildcard LIKE, and per-user rate limits. Budget for caching frequent prefixes if the picker is on a high-traffic screen.
Failure modes to watch.
{id, text}.text values rendered into the dropdown, particularly with user-supplied display names.Ramp-up. Low. A mid-level Laravel developer can read the bundle's form type and JS in under an hour and reproduce the behavior in a day. The package's genuine contribution is as a reference implementation of a well-scoped UX contract; treat it as documentation, not as a dependency, and note that its 0-star / 0-dependent profile is consistent with the low opportunity score — there is no ecosystem momentum to inherit.
How can I help you explore Laravel packages today?