fdmind/ignore-query-strings
A lightweight Laravel package for ignoring query strings in requests and URL comparisons. Skip or strip parameters like utm_source, page, and filters so caching, routing, and matching stay consistent across URLs that differ only by query string.
composer require fdmind/ignore-query-strings. This is a new major (v3.0.0), so pin the constraint (^3.0) and read the README/CHANGELOG/UPGRADE notes before upgrading an existing install — config keys and defaults changed.page, q) and safe paths / URI path exclusions (defaults covering glide and cp-style routes). Run php artisan vendor:publish --tag=ignore-query-strings-config --force and diff against your current config rather than blindly overwriting.web group, or scoped to public marketing routes only./?utm_source=facebook&utm_campaign=spring&fbclid=abc should resolve to the same cached page as /, while /?utm_source=facebook&page=2 must still behave as page 2 (now protected by the default safe params). Verify with curl -I on all three and compare cache headers and redirect behavior.page and q, and add your app's real state params (sort, filter, category, locale, currency, page[size], s, query, offset) to the safe list. Defaults cover the common cases, not your app./admin, /cp, /checkout, /cart, /account, /api, /livewire/*, /filament/*, image-transform routes (Glide-style /img/...), signed asset/preview routes, and auth callbacks. Path exclusions are easier to reason about and audit than a growing param blocklist.glide and cp unless you have remapped those routes — if you mount your control panel or image CDN elsewhere, add your own paths and verify the defaults don't accidentally shadow a public route.utm_*/gclid before analytics JS runs, capture campaign data server-side (session, CRM, event pipeline) or have your analytics tool forward it.?page=2 and ?q=shoes are preserved by default; a custom safe param is preserved; an excluded path is untouched; signed URLs pass through; param keys containing regex metacharacters (utm.source, fbclid[0], a+b) match literally; no redirect loops.page and q are now safe out of the box. If your config previously re-listed them, remove duplicates, and re-run any test that asserted q was stripped.utm_.* or gclid|fbclid inside a single key, that will silently stop matching as a wildcard. Confirm in the source whether wildcards are supported explicitly; if not, enumerate keys./admin vs /admin/ vs /Admin vs /admin/users?utm_source=x, and confirm the query string isn't considered part of the path during matching.php artisan route:list -v and inspect the HTTP kernel/group order.301 gets cached hard by browsers and hurts future attribution; prefer 302 for campaign stripping. Watch for loops if the query string is reintroduced downstream.php artisan config:clear, and clear the response cache when validating or stale entries will mask the result.curl -I and cache headers (X-Cache, Age, Cache-Control), plus logging of the original vs normalized URI. Compare first (uncached) and second request for both clean and tracking URLs.How can I help you explore Laravel packages today?