Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x]Add fluent helper to initialize pipeline processing #54330

Closed

Conversation

Prem-Thakkar
Copy link

@Prem-Thakkar Prem-Thakkar commented Jan 23, 2025

This PR introduces the flow() helper, which sets the object to be processed through the pipeline. It provides a fluent syntax to streamline the use of Laravel's pipeline feature.

Helper Function:

flow($passable) sets the initial object for pipeline processing.

Usage:

flow($data)
    ->through([...])
    ->thenReturn();

Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@Prem-Thakkar Prem-Thakkar marked this pull request as ready for review January 23, 2025 21:01
@shaedrich
Copy link
Contributor

How did you come up with the naming? I would have expected it to be pipeline() or the like 🤔

@taylorotwell
Copy link
Member

Like the naming, but not sure I want to add it to the core. Cool to define in your own project though!

@Prem-Thakkar
Copy link
Author

How did you come up with the naming? I would have expected it to be pipeline() or the like 🤔

Totally get why pipeline() makes sense—it’s the obvious choice! But thinking about how pipelines work, I felt 'flow' was a better fit. It’s like data flowing through transformations, making it feel more intuitive. Plus, it’s snappier and easier to visualize.

@shaedrich
Copy link
Contributor

I honestly like the word "flow". I just couldn't associate with enough with pipelines specifically. But thanks for explaining 👍🏻

@Prem-Thakkar
Copy link
Author

Like the naming, but not sure I want to add it to the core. Cool to define in your own project though!

Thanks for the feedback, Taylor! Totally get it, and I really appreciate you taking the time to review the PR. Glad you liked the naming! 🙌 Thanks again for everything you do for the community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants