定制 henzeb/laravel-pipeline-factory 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

henzeb/laravel-pipeline-factory

最新稳定版本:v1.5.0

Composer 安装命令:

composer require henzeb/laravel-pipeline-factory

包简介

Compose complex pipelines

README 文档

README

Build Status Latest Version on Packagist Total Downloads Test Coverage License

Laravel has a convenient Pipeline to be used to separate the logic in a way that allows modifying an object and allows for easy interchangeable components.

Laravel Pipeline Factory takes it a step further and gives you a couple of 'pipes' to help you build a more complex pipeline.

Example

use Illuminate\Support\Facades\Pipeline;
use Henzeb\Pipeline\Facades\Pipe;
use App\Models\User;

$user = User::find(1);

Pipeline::send($user)
        ->through(
            Pipe::events(
                Pipe::unless(
                    UserEnteredPasswordTwice::class,
                    ReturnInvalidRequestResponse::class
                )->else(
                    Pipe::rescue(
                        Pipe::transaction(
                            [
                                UpdateUser::class,
                                UpdateAddress::class
                            ]
                        ),
                        ReturnFailureResponse::class,
                    )
                ),
                'updateUserDetails'
            )
        )

Installation

Just install with the following command.

composer require henzeb/laravel-pipeline-factory

usage

Every pipe included in this package is invokable. This means you don't have to stick with handle as it's via method.

The following pipes are available:

Testing this package

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email henzeberkheij@gmail.com instead of using the issue tracker.

Credits

License

The GNU AGPLv. Please see License File for more information.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: AGPL-3.0-only
  • 更新时间: 2023-05-15