YoVDO

API Platform 3 Part 3: Custom Resources

Offered By: SymfonyCasts

Tags

Symfony Courses Web Development Courses Doctrine Courses API Development Courses

Course Description

Overview

Thanks to part 1 & part 2, we've already built a seriously powerful API, complete with security, custom fields and many more goodies. In this course, we'll take things even further:

  • State Providers & "proper" custom fields
  • Run custom code on a "state" change (e.g. publishing)
  • Custom (non-entity) DTO #[ApiResource] classes
  • The new stateOptions shortcut for DTO's
  • DTO's & state providers (make:state-provider)
  • State processors with DTO's
  • Data transformation with symfonycasts/micro-mapper
  • IGNORED_ATTRIBUTES, security & other tricks to avoid serialization groups
  • Embedded objects (including non-ApiResource objects)
  • Pagination for DTO resources

Woh. If you thought you were dangerous before with API Platform, just wait...


Syllabus

  • Setup & Ways to Extend API Platform
  • State Providers, Processors & a Custom Field
  • Decorating the Core State Provider
  • Decorating the CollectionProvider
  • Simpler State Processor
  • Running Code "On Publish"
  • Totally Custom Resource
  • Custom Resource State Provider
  • Using a Custom (Date) Identifier
  • Custom Resource Item Provider
  • Custom Resource State Processor
  • Relating Custom ApiResources
  • Embedding Custom DTO's
  • Pagination on a Custom Resource
  • User Class Dto
  • stateOptions + entityClass Magic
  • Entities, DTO's & The "Central" Object
  • Provider: Transforming Entities to DTOs
  • Entity -> DTO Item State Provider
  • DTO -> Entity State Processor
  • Leveraging the Core Processor
  • Controlling Fields without Groups
  • Other Conditional Field Strategies
  • DTO Validation & Security
  • MicroMapper: Central DTO Mapping
  • Reusable Entity->Dto Provider & Processor
  • Quick! Create a DragonTreasure DTO
  • Dtos, Mapping & Max Depth of Relations
  • Making DragonTreasureApi Writable
  • DTO & Security
  • Field Security with Patch
  • Triggering a "Publish"
  • Writable Relation Fields
  • Writing to a Collection Relation
  • Writable Collection via the PropertyAccessor
  • Simpler Validator for Checking State Change

Taught by

Ryan Weaver

Related Courses

API Platform 3 Part 2: Security for your Treasures
SymfonyCasts
Dependency Injection and the art of services and containers
SymfonyCasts
Mastering Doctrine Relations
SymfonyCasts
EasyAdmin! For an Awesomely Powerful Admin Area
SymfonyCasts
EasyAdminBundle v1 for an Amazing Admin Interface
SymfonyCasts