How to JSON:API Quickly and Easily in Laravel
summary
Argues there is no single “best” approach and gives concrete tradeoffs: use Eloquent Resources + spatie/laravel-query-builder for quick work but struggle to produce JSON:API’s flat included documents; use Fractal + fractalistic for built‑in flat includes; use the laravel-json-api package for the most complete, opinionated JSON:API support at the cost of a steeper learning curve. Calls for content negotiation via application/vnd.api+json, rejects unsupported include/sort with 400, and provides a GitHub repo with example branches.
AI-written summary · about
chapters (12)
- 0:00Introduction to JSON:API in Laravel
- 2:50Theory of REST APIs and JSON:API
- 14:42State of APIs today and JSON:API history
- 19:56JSON:API document structure explained
- 25:35HTTP specs and JSON:API conventions
- 30:13Why choose JSON:API over alternatives
- 35:31JSON:API tooling in Laravel
- 41:26Fractal for JSON:API implementation
- 44:37Laravel JSON:API package overview
- 47:50Other API concerns and caching
- 49:12Post-talk considerations and resources
- 50:58Summary and final thoughts
