1. Go to this page and download the library: Download mr-rijal/laravel-pipeline library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
mr-rijal / laravel-pipeline example snippets
use MrRijal\LaravelPipeline\Facades\LaravelPipeline;
use MrRijal\LaravelPipeline\DTO\LaravelPipelineContext;
LaravelPipeline::steps([
fn (LaravelPipelineContext $ctx) => $ctx->set('foo', 'bar'),
fn (LaravelPipelineContext $ctx) => $ctx->get('foo'), // returns 'bar'
])->run();
$results = LaravelPipeline::flow([
fn() => true,
fn() => false, // continue even if fails
fn() => true
]);