zojaji/laravel-workflow
最新稳定版本:v0.2.0
Composer 安装命令:
composer require zojaji/laravel-workflow
包简介
General-purpose workflow engine for Laravel with Spatie integration.
README 文档
README
General-purpose workflow engine for Laravel, with default integration to Spatie's laravel-permission.
Full developer documentation: docs/guide.en.md
Examples: docs/examples.en.md
Persian documentation: docs/guide.fa.md, docs/examples.fa.md
Installation
- Require the package:
composer require zojaji/laravel-workflow
- Publish configs, migrations, and views:
php artisan vendor:publish --tag=workflow-configphp artisan vendor:publish --tag=workflow-migrationsphp artisan vendor:publish --tag=workflow-views
- Run migrations:
php artisan migrate
Dependencies
spatie/laravel-permissionas a primary dependency- Add the
Spatie\Permission\Traits\HasRolestrait to your User model
- Add the
Model Configuration
- In
config/workflow.php:workflow.models.role: Role model class (default:Spatie\Permission\Models\Role)workflow.models.user: User model class (default:config('auth.providers.users.model'))
Quick Usage
- Create a task with decision & assignment:
\Zojaji\Workflow\Facades\Workflow::completeAndRoute($taskId, $userId, $context)
- Finalize user selection for the
role_direct_usermethod:\Zojaji\Workflow\Facades\Workflow::finalizeSelection($instanceId, $stateId, $taskName, $userId, $roleId, $decisionOptions)
Routes
- API is loaded under
api/workflow/*and admin pages underadmin/workflows/*.
License
- MIT
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-02