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

Select2Entity Bundle Laravel Package

kissifrot/select2entity-bundle

A Symfony bundle that turns entity form fields into AJAX-powered Select2 inputs, letting users search and pick related entities from large datasets without loading them all. It provides a form type, autocomplete controller, and configurable endpoints for paginated, server-side entity lookup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor, and the framing needs correcting up front. Despite the "Laravel/PHP package" label in the request, this is a Symfony2 bundle, not a Laravel package. It hooks into Symfony's Form component (EntityType/FormTypeExtension), Twig, and Doctrine's EntityManager. Laravel has no equivalent extension points: no Symfony Form types, no bundle registration, no Doctrine entity field to replace. The only genuinely transferable asset is the pattern — swap a plain entity <select> for a Select2 widget backed by a remote JSON search endpoint — which in Laravel is roughly a Blade component plus a route returning {results: [{id, text}], pagination: {more: bool}}. That is a two-day build, not an integration.

Integration feasibility — effectively zero as a dependency. Installing via Composer pulls Symfony 2.3–2.8-era components (EOL since 2018), Twig 1.x, and PHP 5.x/7.0 constraints that conflict with illuminate/* and will not resolve on a modern Laravel 10/11 project. There is no service provider, no config publishing, no facades, no Blade views — none of the surfaces a TPM would normally assess for adoption. Any attempt to force it in via --ignore-platform-reqs produces a bundle that no part of the Laravel request lifecycle ever invokes.

Technical risk — high, on every axis.

  • Security: Symfony 2.x is unpatched; running any part of it invites CVEs with no remediation path.
  • Health: 1 star, 0 dependents, single maintainer, no security disclosure process, no meaningful issue activity — textbook bus-factor-1 abandonment.
  • Metadata anomaly: last release dated 2026-07-24 against a framework EOL'd in 2018 is inconsistent. Treat that signal as unreliable; verify the tag contents if it ever matters, but it should not change the decision.
  • Hidden cost: forking and modernizing a Symfony2 bundle for a Laravel codebase is strictly more expensive and riskier than reimplementing the pattern.

Key questions for the requester.

  1. Which specific forms need searchable entity selection, and how large are those tables (rows, cardinality of distinct labels)?
  2. Is the requirement a Select2 v4 UX specifically, or just "type-ahead over a big foreign key"? Livewire or a native <datalist> may satisfy the latter at lower cost.
  3. Does search need server-side pagination, or is a bounded client-side list acceptable under, say, 500 options?
  4. Is there already an in-house select2-ajax pattern in the Laravel codebase to standardize on?
  5. Are there legacy Symfony2 apps still using this bundle, making this a modernization trigger rather than a feature request?

Integration Approach

Stack fit — rewrite, don't integrate. Target Laravel + Eloquent + Blade (or Livewire). The deliverable is a reusable <x-entity-select> component plus a controller action using route model binding, a query scope for the search term, and a capped paginate(). Select2 v4 is the client library; the bundle contributes nothing but naming.

Migration path — none from this package; there is nothing to port. If the organization has Symfony2 applications depending on it, that is a modernization signal: reimplement the same JSON contract (results, pagination.more, id, text) on Symfony 6/7 or Laravel so existing front-end JS keeps working, then retire the bundle. If there is no Symfony2 footprint — and with 0 dependents that is likely — there is no migration at all, only a greenfield build.

Compatibility — incompatible as-is. The bundle's constraints (PHP ~5.5–7.0, Symfony 2.x, Twig 1.x) sit two major PHP versions and three Symfony majors behind anything we would run. The Laravel-native replacement targets PHP 8.2/8.3, Laravel 10/11, Select2 4.1.x — all current and supported.

Sequencing.

  1. Confirm the requirement is "searchable foreign-key select" and capture the exact UX (multi-select? tagging? pre-selected values on edit?).
  2. Spike a JSON search endpoint + Select2 widget on one form (1–2 days).
  3. Promote to a shared Blade component with a stable props contract (name, endpoint, placeholder, initial).
  4. Harden: authorization scoping on the endpoint, rate limiting, max page size, input validation on the search term.
  5. If Symfony2 apps exist, port the JSON contract there and schedule decommission of the bundle.

Operational Impact

Maintenance. Adopting the bundle means owning it: upstream is unmaintained, so every PHP or framework bump becomes our patch. The fork-and-port cost dwarfs the ~2-day reimplementation, and the reimplementation sits on code we already know how to support. Recommendation: do not add the dependency; vendor the idea only.

Support. Community support is nil — a README and nothing else. Internal support burden for the Laravel replacement is low and well-understood; Select2 ajax integration is common knowledge on the team, so no single point of failure.

Scaling. The endpoint is the scaling surface, not the widget. A well-built version uses indexed LIKE 'term%' or a dedicated search column, caps results at ~20–50, and paginates with pagination.more. The failure mode to design against is the naive version: LIKE '%term%' full scans plus serializing an entire table, which degrades nonlinearly on large entity tables. Also watch N+1 when mapping models to {id, text} — use select('id', 'name') explicitly.

Failure modes.

  • IDOR / data exposure — the single biggest operational risk. A search endpoint that returns any matching row leaks records the user cannot otherwise see. Scope every query through the same authorization policy as the owning model.
  • Unbounded queries — no page cap means a one-character search can serialize 100k rows and stall the DB.
  • XSS in Select2 templating — custom templateResult that injects HTML from the label must escape.
  • Silent framework-upgrade breakage — only relevant if the bundle itself were vendored, which is another reason not to.
  • Edit-form pre-selection gaps — Select2 requires initial options to be present in the DOM or fetched by ID; a common post-launch defect that silently clears existing values on save.

Ramp-up. Low for the Laravel-native path — a mid-level engineer ships the component in a sprint. Effectively prohibitive for the bundle path: learning Symfony2 Form extension internals in order to port them to Laravel is high-effort, zero-reuse work.

Verdict. Do not adopt. The package scores 15/100 and the scores are honest: it is an abandoned Symfony2 artifact with no dependents and no Laravel surface area. Capture the interaction pattern, reimplement it natively in ~2 days, and invest the saved effort in endpoint authorization and query limits.

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