atannex/ecosystem
Atannex Ecosystem is a Laravel package that integrates the Atannex platform's services and tooling directly into your application, offering streamlined configuration and a consistent API for building connected Laravel projects.
composer require atannex/ecosystem. Confirm your app meets the hard floor: PHP 8.3+ and Laravel 11 or 12. On older runtimes the package simply won't install, so check php -v and laravel/framework in composer.json before you start a branch.SearchService (or a query-object class) that wraps the package keeps the package's query builder out of controllers and makes it swappable if you later move to Scout/Meilisearch.Progressive scope escalation. Start with a direct model query, then add relation depth and JSON paths only where the UX actually needs them. Depth and JSON traversal are the expensive parts; enabling them speculatively on every search endpoint is the fastest way to a slow app.
Treat the search syntax as a parser boundary. Phrases, exclusions, field filters, and ranges mean your users are submitting a mini-language. Parse and normalise input at the edge (form request validation, or a small tokenizer) rather than passing raw ?q= strings straight into the package. This gives you one place to reject malformed ranges, cap the number of terms, and strip operators you don't want exposed.
Global multi-model search as a separate endpoint. Keep "search everything" distinct from per-model listing. Global search usually wants blended ranking, a result-type discriminator in the payload, and highlighting; scoped searches usually want to sit on top of an existing filtered query (tenant, published status, permissions). Mixing them produces a controller with too many conditionals.
Highlighting is presentation, not query logic. Keep the highlight markup out of cached or persisted search results — store match metadata and render highlights at response time so you can change the tag/wrapper without a cache flush. Also escape user content before injecting highlight tags; a highlighting feature is a classic XSS vector if the wrapper is applied to unescaped fields.
Compose with existing constraints. The realistic pattern is search plus your normal scopes: Post::where('tenant_id', $id)->search(...). Verify the ordering of calls against the README, and add a regression test asserting that a tenant-scoped search never returns another tenant's rows — that's the failure that matters and the one ranking logic can accidentally break.
Pagination and ranking stability. Ranked results plus offset pagination can duplicate or skip rows when the underlying data changes between pages. Add a deterministic tiebreaker (usually primary key) to the ordering, and prefer cursor pagination for infinite-scroll UIs.
Cache at the endpoint, not the model. Search results are user- and query-dependent. Cache keyed on the normalised query plus the scope identifiers (tenant, user role), with a short TTL, and invalidate on writes to the searched models if you need freshness.
utf8mb4_unicode_ci MySQL and PostgreSQL LIKE. Decide explicitly whether search is case-insensitive and write tests that pin the behaviour.C++ or state-of-the-art are the ones who find this.with() the relations your view needs and assert query count in a test.^1.0 and read the changelog on upgrades; avoid dev-main in production.DB::listen or toSql()) at each step; the generated query tells you immediately whether the problem is parsing, joins, or data.How can I help you explore Laravel packages today?