Support the ongoing development of Laravel.io →
Eloquent Packages API
1

In your BaseFilters implementation (assuming it dynamically maps a query string like ?sort_by=name&sort_dir=desc to the builder), make sure you are strictly validating against your protected array $sortable whitelist. If a user passes an unvalidated string directly into a raw orderBy or a standard orderBy without strict checking, it can occasionally lead to unexpected behavior or vulnerabilities.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Ahmed Ezz ahmedezz20 Joined 28 Sep 2020

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2026 Laravel.io - All rights reserved.