API Platform: State providers
20 November 2022 (Updated 20 November 2022)
In a nutshell
State providers are classes that retrieve data exposed by your API. They’re a new feature of API Platform 3 and replace the data providers from API Platform 2.
An example state provider
1. Create a state provider
Assuming you have the Symfony MakerBundle installed, you can run the below to quickly create a custom provider:
An example provider looks like this:
2. Configure operation to use state provider
Sources
Tagged:
API Platform
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment