State management in Api Platform
Fetch data and mutate state for custom api resources when using the Api Platform framework.
Define an api resource⌗
The following defines an api resource for a product. Note the provider classes set for the operations annotation.
State Providers⌗
The following defines a state provider for the above resource.
State Processors⌗
Continuing with the above resource, in order to mutate its state a new operation should be configured. E.g to enable post request to create new product:
And the corresponding processor:
Read the documentation for more info on state providers and state processors.
Read other posts