--- date: 2025-06-20 title: My thoughts on the Action pattern permalink: /daily/2025/06/20/my-thoughts-action-pattern --- The Action pattern is a relatively new design pattern that's become popular in the PHP community, particularly with Laravel Developers. The pattern is a simplified version of the Command pattern, with no separate Handler class. The Action class is responsible for the handling and execution logic. In most cases, an Action class only has a single public method called `execute()` or `handle()`, or uses PHP's `__invoke()` magic method. This is a different approach from a Service class that has multiple methods to perform different tasks. Here's a simplified version of the code of an Action from my website: ```php