Skip to content

Fix date filters broken by Blade HTML-encoding#100

Merged
SimonBarrettACT merged 1 commit intomainfrom
bugfix/html-safe-filter-codes
Feb 20, 2026
Merged

Fix date filters broken by Blade HTML-encoding#100
SimonBarrettACT merged 1 commit intomainfrom
bugfix/html-safe-filter-codes

Conversation

@SimonBarrettACT
Copy link
Member

@SimonBarrettACT SimonBarrettACT commented Feb 20, 2026

Summary

  • Map >=, <=, >, < operators to HTML-safe aliases (gte, lte, gt, lt) in filter codes via a new buildCode() method on BaseFilter
  • The actual SQL operator property is unchanged — only the code used for wire:model bindings and lookups is affected

Closes #99

Test plan

  • Verified fix with Tinker: filter codes no longer contain HTML-special characters
  • Added Pest tests for LeaversTable date filters (after, before, and range) — all pass
  • Verify date filters work in browser on LeaversTable, ExitInterviews, and Expenses reports

🤖 Generated with Claude Code

Filter codes containing >= or <= operators were being HTML-encoded
by Blade's {{ }} syntax (e.g. >= became &gt;=), causing a mismatch
between the Livewire wire:model binding key and the PHP lookup key.
This made all date filters with comparison operators silently fail.

Operators are now mapped to safe aliases (gte, lte, gt, lt) in the
filter code while keeping the actual SQL operator unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@SimonBarrettACT SimonBarrettACT force-pushed the bugfix/html-safe-filter-codes branch from e3d8e3f to e136487 Compare February 20, 2026 12:41
@SimonBarrettACT SimonBarrettACT merged commit 81eb391 into main Feb 20, 2026
2 of 10 checks passed
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.

Date filters with >= or <= operators do not work

1 participant