Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

SymfonyCasts

API Platform Part 3: Custom Resources

via SymfonyCasts

Overview

Welcome to part 3 of the Api Platform series! In part 1, we built a fully-featured API. Then in part 2 we leveled-up by adding a robust security system, security checks and user-specific fields. So what's left? In part 3, we're taking customizations to the next level: A RESTful implementation of a "publish" action Complex ACL rules around who can publish under different conditions Doing custom actions before save with a data persister Truly custom fields via a data provider Completely-custom, non-entity API resources Adding pagination to custom resources Custom filters (for entity and non-entity resources) The input/output DTO system Using UUID's Phew! Yep, in this tutorial, we're going deep into customizations. Ready? Let's go!

Syllabus

  • 01. App & Test Setup
  • 02. Data Persister Decoration
  • 03. Decorating Data Persisters vs Context Builders
  • 04. Custom Logic Only for some Operations
  • 05. Publishing a Listing
  • 06. Detecting the "Published" State Change
  • 07. Validating Who/When Can Publish
  • 08. Publish State Change Validator Logic
  • 09. Completely Custom Field via a Data Provider
  • 10. Leveraging the Doctrine Data Provider
  • 11. Adding & Populating the Custom Field
  • 12. Custom Item Data Provider
  • 13. Setting a Custom Field Via a Listener
  • 14. Core Listeners & Accessing the "Resource" Objects
  • 15. Doctrine postLoad Listener
  • 16. Completely Custom Resource
  • 17. Custom Resource Data Provider
  • 18. Property Metadata
  • 19. Why/When a Many Relation is IRI Strings vs Embedded
  • 20. Collection "Types" and readableLink
  • 21. Custom Resource GET Item
  • 22. Custom Paginator
  • 23. Pagination Context
  • 24. Custom Resource PUT Operation
  • 25. Custom Filter, getDescription() & properties
  • 26. Custom Filter Logic for Entities
  • 27. Custom Filter for Custom Resources
  • 28. Custom Filter apply()
  • 29. Filter Class Arguments
  • 30. Filter Autowiring
  • 31. Output DTO Class
  • 32. DTO Data Transformer
  • 33. Output Properties & Metadata
  • 34. DTO Quirks
  • 35. DTO Quirks: Embedded Objects
  • 36. Input DTO Class
  • 37. Input DTO: Denormalizing IRI Strings
  • 38. Input Data Transformer
  • 39. Input DTO Update Problems
  • 40. DTO Input "Initializer"
  • 41. DTO Input Initializer Logic
  • 42. DTO Class Organization
  • 43. Type Validation
  • 44. Input DTO Validation
  • 45. UUID's
  • 46. UUID as a API Identifier
  • 47. Setting the UUID on POST
  • 48. UUID Quirk with "id" Name

Taught by

Ryan Weaver

Reviews

Start your review of API Platform Part 3: Custom Resources

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.