Urgent.News

What's breaking now, across thousands of outlets.

Tech

Laravel Pipeline Class: Multi-Step Flows Explained

Every request to your Laravel app travels through a stack of middleware: each one does some work, then hands the request to the next. The class that makes this happen is not private to the framework. It is Illuminate\Pipeline\Pipeline , and you can send anything through it: an order during checkout, a row from a CSV import, a text that needs cleaning. This article explains how it works in plain…

A Laravel pipeline class named Illuminate\Pipeline\Pipeline allows you to create multi-step flows for processing data. Each request that comes into a Laravel app moves through a series of middleware, with each piece of middleware handling its own job before passing the request to the next middleware. The Pipeline class can process anything, such as an order during checkout, a row from a CSV import, or text that needs cleaning.

The system works by creating a series of stations, each with a handle() method. These stations receive an object and a $next closure. After completing their job, the stations pass the object on by calling $next. The Pipeline class, which forms the backbone of the Laravel framework's middleware stack, allows you to build custom pipelines with similar functionality.

Example 1 demonstrates cleaning imported data through multiple stations: TrimStrings, LowercaseEmail, NormalizePhone, and DefaultCountry. The input data is processed by each station, and the result is as follows: name: Ada Lovelace, email: ada@example.com, phone: 94771234567, country: GB.

In example 2, a checkout flow is created with steps that must succeed together. These steps include calculating the total, reserving stock, creating an order, and charging the card. The final step throws an exception to simulate a declined payment card. With the withinTransaction() method, any failed steps in the transaction are rolled back, ensuring that stock and orders are not affected by the declined card.

However, external services like payment providers and email providers should be handled outside the transaction, as they cannot be undone.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

WiFi QR Code Generator Free — Share Your Password Without Typing It

Disclosure: I'm the maker of All Done (all-done.xyz), a site of free online tools — no signup, no cost Stop dictating your 20-character WiFi password letter by letter.

  • WiFi QR code generator simplifies password sharing.
  • Enter SSID, security type, and password online.
  • Print and place code in visible, accessible location.

There's More to Life Than Code

The conversations I have with myself I talk to myself a lot. Not because I'm mad. Not because something is wrong with me. I talk to myself because I'm searching.

  • Author balances coding, startups, job, and family life
  • Finds peace in gardening, nature, gratitude, and prayer
  • Emphasizes importance of personal life alongside professional pursuits

Your HTTP/3 endpoint is only as patched as the QUIC library behind it

Your HTTP/3 endpoint is only as patched as the QUIC library behind it On 20 October 2026, FoxIO published full details and proof-of-concept code for "Header Accordions", a QPACK amplification attack…

  • HTTP/3 security depends on QUIC library implementation
  • Seven out of ten tested QUIC libraries vulnerable to Header Accordions attack
  • Recommendations include identifying QUIC library, disabling vulnerable stacks

More from Sunday 25 October →