Skip to content

Commit

Permalink
Add note about orderable column.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Nov 3, 2019
1 parent 779ebe8 commit 2720e29
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ $orderable = new Orderable(
return $orderable->apply($query)->get();
```

> The code will validate the column name before trying to apply `orderBy()` to the query, this would prevent SQL injection especially when column is given by the user.
```sql
select * FROM `users` ORDER BY `name` DESC;
```
Expand Down

0 comments on commit 2720e29

Please sign in to comment.