~/talk

Filtering API: REST APIs with Some of GraphQL's Conveniences

TalkinItalianat phpday PUG Edition 2020 · on Tuesday, 2020-06-02· [php, web-platform]
github:oniz93
slides:none on file

Shows how to add a query-string DSL to REST endpoints so clients can filter (eq, like, <, <=, >, >=, between), sort, paginate (limit/offset) and select fields without changing controllers. Presents a custom single-method PHP class that parses those operators and returns JSON, and also demonstrates using Spatie Query Builder with Eloquent for the same configurable, extensible behavior while noting the need for validation and careful placement to avoid surprising query semantics.

AI-written summary · about

  1. 0:00Introduction
  2. 3:18Talk context
  3. 4:47REST filtering problems
  4. 6:35Laravel Query Builder demo
  5. 10:59Custom filtering class
  6. 13:58Testing custom class
  7. 18:31Eloquent Query Builder integration
  8. 20:21Eloquent models and filters demo
  9. 26:08Spatie Query Builder advanced ops
  10. 29:35Configuration troubleshooting
  11. 31:27Q&A: Multi-sort
  12. 34:57Q&A: GraphQL similarities
  13. 36:47Q&A: Model vs controller logic
  14. 38:00Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.