Skip to content

Commit

Permalink
updated docs, added logo
Browse files Browse the repository at this point in the history
  • Loading branch information
matthenning committed Jul 30, 2023
1 parent 3974696 commit 764224d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# eloquent-api-filter
<p align="center"> <img src="logo.png" width="200px"></p>
<h1 align="center">eloquent-api-filter</h1>
<p align="center">
Awesome and simple way to filter Eloquent queries right from the API URL.

This library allows you to use a single generic controller to handle even complex API requests.
</p>

# Installation
## Package installation
Expand Down Expand Up @@ -99,7 +100,8 @@ Matches all users whos' birthdays are today

`.../users?filter[birthday]=today`

###
<p><br /></p>

## Sorting

### URL Syntax
Expand All @@ -113,7 +115,8 @@ Matches the top 10 users with age of 21 or older sorted by name in ascending ord

`.../users?filter[age]=ge:21&order[name]=asc&limit=10`

###
<p><br /></p>

## Select fields

Select only specific columns. Might need additional work on your model transformation.
Expand All @@ -126,7 +129,8 @@ Select only specific columns. Might need additional work on your model transform

`.../users?select=name,email`

###
<p><br /></p>

## Joins

### URL Syntax
Expand All @@ -141,7 +145,8 @@ Join posts-relation on users

`.../users?with[]=posts`

###
<p><br /></p>

## Complex values

If you need to filter for a value with special characters, you can base64 encode the field to avoid breaking the filter syntax.
Expand All @@ -154,7 +159,8 @@ If you need to filter for a value with special characters, you can base64 encode

`.../model?filter[field]=lt:{{b64(MjAxNy0wNy0yMiAyMzo1OTo1OQ==)}}`

###
<p><br /></p>

### Known issues

* Sorting by related fields doesn't work yet.
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 764224d

Please sign in to comment.