3neti/form-flow
Composer 安装命令:
composer require 3neti/form-flow
包简介
Driver-based form flow orchestration system with DirXML-style mapping for Laravel applications
README 文档
README
Driver-based form flow orchestration system with DirXML-style mapping for Laravel applications.
Features
- Driver-Based Architecture: Define multi-step form flows using YAML configuration files
- DirXML-Style Mapping: Transform and map data between steps using flexible mapping rules
- Handler Plugin System: Extend functionality with custom form handlers
- Built-in Handlers: FormHandler, SplashHandler, and MissingHandler included
- Vue Components: Pre-built Inertia.js Vue components for rapid development
- Configurable: Customize route prefixes, middleware, and behavior
- Self-Contained: Automatic CSRF handling, route registration, and asset publishing
Requirements
- PHP ^8.2
- Laravel ^11.0 || ^12.0
- Inertia.js ^2.0
Installation
Install via Composer:
composer require 3neti/form-flow
Publish Assets
Publish the configuration file:
php artisan vendor:publish --tag=form-flow-config
Publish driver examples:
php artisan vendor:publish --tag=form-flow-drivers
Publish Vue components:
php artisan vendor:publish --tag=form-flow-views
Or publish everything at once:
php artisan vendor:publish --tag=form-flow-core
Configuration
The package configuration is located at config/form-flow.php:
return [ 'route_prefix' => env('FORM_FLOW_ROUTE_PREFIX', 'form-flow'), 'middleware' => ['web'], 'driver_directory' => config_path('form-flow-drivers'), 'session_prefix' => 'form_flow', 'handlers' => [ // Plugin handlers register themselves via service providers ], ];
Usage
Creating a Form Flow
Define a flow driver in config/form-flow-drivers/my-flow.yaml:
name: my-flow title: My Form Flow steps: - handler: splash config: title: Welcome message: Let's get started - handler: form config: title: User Information fields: - name: full_name type: text label: Full Name validation: required|string|max:255
Starting a Flow
use Illuminate\Support\Facades\Http; $response = Http::post('/form-flow/start', [ 'reference_id' => 'unique-transaction-id', 'steps' => [ ['handler' => 'splash', 'config' => [...]], ['handler' => 'form', 'config' => [...]], ], 'callbacks' => [ 'on_complete' => 'https://your-app.com/api/flow-complete', 'on_cancel' => 'https://your-app.com/api/flow-cancelled', ], ]); $flowUrl = $response->json('flow_url');
Available Routes
The package automatically registers these routes:
POST /form-flow/start- Start a new flowGET /form-flow/{flow_id}- Show current stepPOST /form-flow/{flow_id}/step/{step}- Update step dataPOST /form-flow/{flow_id}/complete- Complete flowPOST /form-flow/{flow_id}/cancel- Cancel flowDELETE /form-flow/{flow_id}- Destroy flow state
Plugin Development
Create custom handlers by implementing FormHandlerInterface:
use LBHurtado\FormFlowManager\Contracts\FormHandlerInterface; class MyCustomHandler implements FormHandlerInterface { public function getName(): string { return 'my-custom'; } public function handle(Request $request, FormFlowStepData $step, array $context = []): array { // Process step data return ['processed' => true]; } public function render(FormFlowStepData $step, array $context = []) { return inertia('MyCustomView', [...]); } // ... other methods }
Register in your service provider:
public function boot(): void { $handlers = config('form-flow.handlers', []); $handlers['my-custom'] = MyCustomHandler::class; config(['form-flow.handlers' => $handlers]); }
Vue Components
The package includes ready-to-use Vue components:
GenericForm.vue- Generic form rendererSplash.vue- Splash screen handlerComplete.vue- Flow completion pageMissingHandler.vue- Fallback for missing handlers
Testing
composer test
Changelog
Please see CHANGELOG for recent changes.
License
The MIT License (MIT). Please see License File for more information.
Credits
3neti/form-flow 适用场景与选型建议
3neti/form-flow 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.13k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 12 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wizard」 「mapper」 「driver」 「laravel」 「vue」 「inertia」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 3neti/form-flow 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 3neti/form-flow 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 3neti/form-flow 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
data-mapper php library
Provides methods to create, validate and render HTML forms in PHP.
Convention-based Alternative ORM
Site generator / tree model duplicator used to generate mini-website or duplicate tree model
Galera cluster driver for Doctrine
A PHP client driver for the RethinkDB query language (ReQL)
统计信息
- 总下载量: 1.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 24
- 依赖项目数: 5
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-24