Skip to content

fix(api): enable ilike filter for REST API search#806

Open
vcnainala wants to merge 2 commits into
developmentfrom
fix/api-search-ilike-filter
Open

fix(api): enable ilike filter for REST API search#806
vcnainala wants to merge 2 commits into
developmentfrom
fix/api-search-ilike-filter

Conversation

@vcnainala

Copy link
Copy Markdown
Member

Summary

  • Add ilike to allowed Lomkit REST API search filter operators for PostgreSQL case-insensitive matching
  • Extend Lomkit SearchRequest validation via dedicated App\Http\Requests\Rest\SearchRequest and custom search rules
  • No custom query builder required — Laravel's PostgreSQL grammar already handles ilike once validation passes

Closes #335

Supersedes the closed PR #398, which targeted an older Lomkit API and included unnecessary CustomBuilder wiring.

Test plan

  • php artisan test --filter=MoleculeSearchIlike
  • ilike matches case-insensitively (e.g. %caffeine% finds Caffeine)
  • like remains case-sensitive on PostgreSQL
  • Unknown operators return 422 validation error

Extend Lomkit search validation to accept the PostgreSQL ilike operator,
enabling case-insensitive filtering on REST resource endpoints.

Closes #335
@codecov-commenter

codecov-commenter commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.83333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 7.07%. Comparing base (4223a58) to head (25a53d5).

Files with missing lines Patch % Lines
app/Rules/Search/SearchFilter.php 94.59% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             development    #806      +/-   ##
================================================
+ Coverage           6.13%   7.07%   +0.93%     
- Complexity          1737    1744       +7     
================================================
  Files                227     230       +3     
  Lines               8961    9008      +47     
================================================
+ Hits                 550     637      +87     
+ Misses              8411    8371      -40     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Remove empty constructor parentheses and align unary operator spacing so PHP Lint & Security passes on PR #806.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants