laravel5-jsonapi icon indicating copy to clipboard operation
laravel5-jsonapi copied to clipboard

Query parameter: Filter

Open IMucaMI opened this issue 8 years ago • 4 comments

Whether this option is implemented? How to Use it, maybe I did not understand? Request type /comments?filter[post]=1 or /comments?post=1 does not give any results.

IMucaMI avatar Jul 08 '16 11:07 IMucaMI

Filtering is not implemented as the JSONAPI does not enforce any kind of standard on this.

It is read but not used throught the code.

https://github.com/nilportugues/php-json-api/blob/master/src/Http/Request/Request.php#L109

I've got plans on supporting this, as I've got it coded in a private project already. But need to write tests for this.

nilportugues avatar Jul 20 '16 10:07 nilportugues

+1 for this

jeremymlane avatar Aug 03 '16 17:08 jeremymlane

@nilportugues Feel like sharing the code for what you have in your private project? I don't care about the tests at this point.

jeremymlane avatar Aug 03 '16 17:08 jeremymlane

@jeremymlane: I've implemented my own solution using RQL if you're interested - take a look here:

https://github.com/srottem/laravel5-jsonapi/tree/feature/filters

I don't know if Nil will want to pull it in and it's not extensively tested yet, but it seems to be working for my use cases.

srottem avatar Sep 24 '16 17:09 srottem