Sometimes you have a controller method that started small and did not stay that way. You validate the request, create a record, then fired a couple of side effects, return a response, ect.

Every one of those steps is real work, and none of it belongs in the controller, but that is where it lands because the controller is where the request arrives.

Laractions is a small package for moving that work into single-purpose classes. This post is a straight refactor: one fat controller method pulled apart into an action you can call from anywhere.

How to install

Install via Composer. The service provider auto-registers and there is nothing to publish to get going: