API Platform State Processor Generator

0•

Generates custom API Platform State Processors to handle sophisticated data persistence logic for write operations.

This skill streamlines the creation of API Platform State Processors, enabling developers to inject custom business logic during the data persistence lifecycle. It supports multiple strategies including decorating the default Doctrine processor for pre/post-save actions, full custom persistence logic, or asynchronous handling via Symfony Messenger. By automating the boilerplate and configuration, it ensures consistent implementation of best practices like final readonly classes, proper interface implementation, and operation-specific handling for POST, PUT, PATCH, and DELETE requests.

Key Features

01Automates project namespace detection from composer.json
02Handles specific operation logic for Creation, Update, and Deletion
03Provides ready-to-use service configuration and PHP attribute snippets
04Generates boilerplate-free State Processor classes with PHP 8+ features
050 GitHub stars
06Supports multiple strategies: Doctrine decoration, custom logic, or Messenger integration

Use Cases

01Dispatching messages to a queue for asynchronous processing of API write requests
02Implementing soft-delete logic or cascading operations during the DELETE phase
03Adding side effects like sending emails or invalidating cache after a resource is saved