tlikai/laravel-repository
A Laravel package that adds a clean repository layer to your app, wrapping database queries behind interfaces for better separation of concerns, easier testing, and swappable data sources. Ships with base repository classes and service provider bindings for quick setup.
FuzzySearch: previously, chaining FuzzySearch (which emits OR between its fields) with AttributeSearch (which emits AND) produced unparenthesised SQL, so the AND filter bound only to the last OR branch. In practice a name-match could bypass the city filter entirely, and a pinyin match could ignore it too. Post-1.0.5 the fuzzy group is wrapped, so (name LIKE … OR pinyin LIKE …) AND city = …. This directly changes result set composition for any multi-field search plus filter screen — expect result counts to drop and previously "impossible" rows to disappear.pushCriteria) lets the team layer fuzzy keyword matching on translatable fields (name, pinyin) with exact attribute filters (city), building a usable Chinese-market search/filter experience on plain MySQL. This is a credible v1 for catalogue, user directory, CRM, or admin listing screens, deferring Elasticsearch/Meilisearch spend.where closures, so "build custom" loses an argument.LIKE "%term%" cannot use an index and will table-scan; introduce prefix search, generated pinyin columns with indexes, or a search engine once row counts or latency budgets bite, (c) relevance/ranking and typo tolerance, both out of scope for LIKE.LIKE '%term%' semantics will not get you there.FuzzySearch with AttributeSearch (or any AND-emitting criterion), and look for local workarounds that added manual grouping or reordered criteria to compensate for the bug; those will now double-group or filter incorrectly. Run regression comparisons on result counts before rollout, and pin the version explicitly rather than floating.To executives: We depend on a small Laravel search component to power keyword-plus-filter screens (search by name or pinyin, filter by city) without paying for a search cluster. Version 1.0.5 fixes a defect where our city filter was silently ignored for some keyword matches — meaning users could see results outside their selected filter. The fix is small and contained, but it changes what users see: result counts on affected screens will drop to the correct set. Recommendation: ship it, run a short QA pass on search screens, and flag that our current keyword search will need investment (indexing or a search engine) as data grows, because it scans the whole table per query.
To engineering: Upgrade to 1.0.5 and verify grouped SQL for any criteria chain mixing FuzzySearch with AttributeSearch. Remove any local query-grouping workarounds added to compensate for the old behaviour. Add regression tests asserting the emitted WHERE clause shape for chained criteria — this class of bug is invisible to happy-path tests. Separately, open a ticket on leading-wildcard LIKE cost and index strategy for name/pinyin.
How can I help you explore Laravel packages today?