Batching Laravel Jobs

September 27, 2024

Batching Jobs

Got to do something new today! I had the opportunity to work with batching Laravel Jobs which was pretty awesome. It was a lot easier and less scary than I thought it was going to be. What I needed to accomplish was add order notes to potentially any number of WooCommerce orders via their API. However, WooCommerce does not have an endpoint for batch adding notes to orders like they do for batch creating, updating and deleting orders. The reason I opted for batching these requests vs just dispatching each request as its own Job was because I needed to know when ALL of the orders being processed under the current command execution were successfully updated.


© 2024 Terrence Eisenhower. All rights reserved.