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

Select2 Laravel Package

public-repo/select2

A Laravel package for integrating Select2 dropdowns into your forms, with helpers for AJAX-loaded options, model binding, and searchable selects. Quickly add rich, user-friendly select inputs without wiring up JavaScript yourself.

View on GitHub
Deep Wiki
Context7

A fork of select2entity-bundle for Symfony 7.0 and PHP 8.0+ support. A Symfony bundle that integrates Select2 as a drop-in replacement for a standard entity field on a Symfony form.

Frequently asked questions about Select2
Is public-repo/select2 a Laravel package or a Symfony bundle?
The source assessment identifies it as a fork of select2entity-bundle, which is a Symfony bundle, despite the Laravel-oriented package description. Laravel has no bundle registry, DependencyInjection extension contract, or Twig form theme system like Symfony. Treat the Laravel claims skeptically and verify the actual source before installing it in any Laravel application.
How do I install public-repo/select2 in a Laravel application?
There is no verified Laravel installation path, and the package may not be available on Packagist with release metadata. If you are targeting Symfony, add the GitLab repository as a Composer VCS source and pin an explicit commit SHA instead of a branch. For Laravel, avoid this package and implement a native Blade select plus a JSON search route instead.
Does public-repo/select2 support Laravel 10 or Laravel 11?
No verified Laravel version support exists because the package appears to depend on Symfony bundle architecture rather than Laravel service providers. Laravel version support is therefore not applicable in the way it would be for a normal Laravel Composer package. Use a native implementation, Tom Select, or Filament searchable selects for Laravel 10 and 11.
How do I load Select2 options via AJAX in Laravel without this package?
Render a standard select element in Blade and initialise Select2 with an AJAX URL pointing to a Laravel route. Have the controller return the expected JSON payload with results containing id and text fields. Add pagination, authorization scoping, and query filtering in that controller. This native approach covers roughly ninety percent of the use case this package describes.
Can I bind an Eloquent model with preselected values using this package?
The package description claims Eloquent model binding and preselected values, but the assessed implementation appears to be a Symfony entity form type. In Laravel, bind preselected values by setting selected attributes in Blade or by passing an initial option to Select2. Your AJAX endpoint can also return the current selection as the first result. Do not rely on Symfony form-type behaviour inside Laravel.
What are the security concerns with Select2 AJAX endpoints?
An AJAX Select2 endpoint queries records using user-supplied search text, so authorization scoping, rate limiting, and result-set bounds are essential. The package leaves those responsibilities to the integrating team rather than enforcing them itself. Validate and limit the search term, authorize access per model or tenant, and cap returned results. Treat the endpoint like any other public JSON API.
Is public-repo/select2 maintained and production ready?
The assessment reports zero stars, zero dependents, and no release metadata, which indicates an unvetted single-maintainer fork. Abandonment risk is high because the fork exists for a narrow Symfony 7 and PHP 8.0 compatibility gap. It is not production ready without a source audit, licence verification, and a pinned commit. Expect manual wiring rather than semantic-version upgrades.
What is the license and provenance of this Select2 integration?
You should verify which upstream tag or commit the fork diverges from and whether it preserves the upstream MIT license and attribution. Flex-era forks often omit upstream recipe and composer.json metadata such as type symfony-bundle and branch aliases. Confirm the diff is a minimal compatibility patch rather than a divergent rewrite. Also identify the internal owner and patch-merge policy before committing.
What are alternatives to public-repo/select2 for searchable selects in Laravel?
Use a native Eloquent-backed search endpoint with Select2 or Tom Select wired directly in Blade. Filament provides built-in Select and Searchable relation fields if you already use that admin stack. Livewire also offers searchable select patterns with server-side querying. Reimplementation is typically days of work and avoids owning a Symfony fork.
How do I test Select2 AJAX selects in a Laravel app?
Write feature tests for the JSON search endpoint, asserting the results array shape, id and text fields, pagination, and authorization behaviour. Use Laravel Dusk or another browser test for the JavaScript initialisation and user interaction. Mock or seed models so the query filtering and result bounds are deterministic. Do not rely on the package for endpoint tests because the endpoint is your application code.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections