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
Needle Bundle

Needle Bundle Laravel Package

markup/needle-bundle

Symfony bundle from markup that integrates the Needle library into your application, handling service registration and configuration so you can start using it with minimal setup. Install via Composer, enable the bundle, and adjust configuration as needed.

View on GitHub
Deep Wiki
Context7

A Symfony bundle for search. Defines a standard way of building search queries (including filters and faceting) and reading result sets. Integrates with search backends (currently Solr/ Solarium & Elasticsearch).

Frequently asked questions about Needle Bundle
Is markup/needle-bundle compatible with Laravel?
No. It is a Symfony bundle that ships a Bundle class, a dependency-injection extension, and a configuration tree, and Laravel has no loader for any of those artifacts. Adopting it in a Laravel app would require forking and rebuilding service registration and aliasing in a service provider, translating the config tree into config/needle.php, and swapping Symfony's EventDispatcher for Laravel's. Treat it as a porting project, not a Composer dependency.
Can I use markup/needle-bundle together with Laravel Scout?
Not cleanly. Scout abstracts model indexing and synchronization through a driver contract, while Needle abstracts query construction with filters, facets, and pagination, and Needle does not implement Scout's driver contract. The two overlap partially and compose poorly, so you would end up maintaining two search abstractions with different mental models. Composer constraint resolution against Laravel 10, 11, or 12 will likely fail before you reach runtime anyway.
Which search backends does Needle support?
It integrates with Solr through Solarium and with Elasticsearch. The last release was in July 2021, which predates the Elasticsearch PHP client's breaking 7.x to 8.x rewrite, so the Elasticsearch integration is likely incompatible with current clusters. Solr faceting and Elasticsearch aggregations also differ enough semantically that any standard abstraction will leak, leaving you with common-denominator features plus backend-specific escape hatches.
How do you install and configure the bundle?
In Symfony you install it with Composer, enable the bundle in your kernel or bundles.php, and adjust the bundle's configuration tree. In Laravel none of those steps apply: the bundle class and DI extension are not loaded, so there is no configuration to publish. A Laravel adoption means hand-writing a service provider and a config/needle.php equivalent, which is a multi-day port rather than a setup task.
Does Needle handle faceting and filtered search queries?
Yes, that is its core value proposition: a backend-neutral query object model covering filters, facets, and pagination so call sites do not need rewriting when you switch between Solr and Elasticsearch. The catch is that Solr faceting and Elasticsearch aggregations are semantically different, so the abstraction will express only the lowest common denominator. Verify early whether your specific facet and filter requirements fit the shared model or push you into backend-specific code.
Is markup/needle-bundle still actively maintained?
No. The last release was 2021-07-27, leaving it roughly three years dormant, with about 4 stars and 0 dependents on Packagist. That means no downstream consumers have validated the integration seams, no bug reports have exercised edge cases, and there are no shared fixes to rely on. It is effectively a single-maintainer package with a bus factor of one, though the MIT license at least makes forking clean legally.
What are the best alternatives for search in a Laravel application?
Laravel Scout with Meilisearch or Typesense is the recommended path: it is native to Laravel, actively maintained, and the driver contract is well understood by most teams. If you need Elasticsearch-specific behavior, write a thin internal abstraction over the Elasticsearch PHP client or over Scout rather than porting a dormant Symfony bundle. You can still harvest Needle's query, filter, and facet value-object design as inspiration without inheriting its maintenance tail.
Why does composer require fail for Laravel 10, 11, or 12?
The 2021 release window implies Symfony 4.4 or 5.x and PHP 7.4 or 8.0 constraints, while a modern Laravel stack targets PHP 8.1 through 8.3 with newer Symfony components underneath. Dependency resolution therefore conflicts before you ever hit runtime. Even if you force the constraints, expect API-level breakage in the search client integration afterward.
Should I fork markup/needle-bundle to use it in Laravel?
Only if Solr and Elasticsearch are both genuinely required and actively swapped in your stack. A fork means reconstructing service registration in a service provider, translating the config tree, replacing the Symfony event dispatcher, and removing residual http-kernel and console coupling, which is roughly two to four weeks plus permanent ownership. At 4 stars and 0 dependents that cost is hard to justify, and you would also need to name an owner and a deprecation trigger for the fork itself.
What are the production risks of using Needle in a Laravel app?
Technical risk is high to critical: the package is unmaintained, untested against PHP 8.1+, and its Elasticsearch integration likely predates the 8.x client rewrite. There is no community validation, no shared bug fixes, and no one else absorbing the porting cost if you adopt it. If search is commodity infrastructure for your product, Scout plus a managed engine delivers the same outcome in days rather than weeks with a far smaller maintenance tail.
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.
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
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource