bantenprov/workflow 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

bantenprov/workflow

Composer 安装命令:

composer require bantenprov/workflow

包简介

The Workflow package for manage state and transition

README 文档

README

Join the chat at https://gitter.im/bantenprov-workflow/Lobby Scrutinizer Code Quality Build Status

Workflow Management

Workflow management for easily manage states and transitions in a complex business prosess.

The final of this package will be contained some awesome feature:

  • Workflow
  • Workflow State
  • Workflow Transition
  • Workflow Notification
  • Workflow Guard
  • Transition Attachment
  • Attachment
  • Notification To
  • Notification cc
  • History

Workflow Management

Join the chat at https://gitter.im/bantenprov-workflow/Lobby Workflow management for easily manage states and transitions in a complex business prosess.

Scrutinizer Code Quality Build Status

The final of this package will be contained some awesome feature:

Worklow

  • Define a name and descriotion of the workflow, each conte type could containt more then one workflow to manage their business process

State

  • Define a collection of state name in worflow related, and describe the latest status the content in a business process

Transition

  • Define a transition of any state in content, this feature will be handle move transition

Guard

  • Guard give a permission to manage one or any authorization of the role management to the transition related

Notification

  • When a state of content was change, or a transition executed a notification will be sent by system to pic related. notification displayed in user desktop related and as mail notification.

TODO

See TODO before use this.

DEMO

Demo site for this packages is available here : Workflow.

Install Laravel :

$ composer create-project --prefer-dist laravel/laravel project-name "5.4.*"

Install package :

$ composer require bantenprov/workflow "1.0.0"

Edit config/config.php

Edit config/app.php

providers

'providers' => [
    ...
    App\Providers\AppServiceProvider::class,
    App\Providers\AuthServiceProvider::class,
    App\Providers\EventServiceProvider::class,
    App\Providers\RouteServiceProvider::class,
    ...
    Collective\Html\HtmlServiceProvider::class,
    'That0n3guy\Transliteration\TransliterationServiceProvider',
    Bantenprov\Workflow\WorkflowServiceProvider::class,

aliases

'aliases' => [
    ...
    'Storage' => Illuminate\Support\Facades\Storage::class,
    'URL' => Illuminate\Support\Facades\URL::class,
    'Validator' => Illuminate\Support\Facades\Validator::class,
    'View' => Illuminate\Support\Facades\View::class,
    ...
    'Form' => Collective\Html\FormFacade::class,
    'Html' => Collective\Html\HtmlFacade::class,
    'Workflow' => Bantenprov\Workflow\Facades\Workflow::class,

Artisan command :

$ php artisan vendor:publish --tag=workflow_migrations
$ php artisan vendor:publish --tag=workflow_views
$ php artisan vendor:publish --tag=workflow_css
$ php artisan vendor:publish --tag=workflow_js
$ php artisan migrate

Contoh penggunaan :

Trait :

1. WorkflowStateTrait

use Bantenprov\Workflow\Traits\WorkflowStateTrait;

class WorkflowStateController extends Controller
{
    use WorkflowStateTrait;

    public function index()
    {
        return WorkflowStateTrait::stateIndex();
    }
}

2. WorkflowTransitionTrait

use Bantenprov\Workflow\Traits\WorkflowTransitionTrait;

class WorkflowTransitionController extends Controller
{
    use WorkflowTransitionTrait;

    public function index()
    {
        return WorkflowStateTrait::transitionIndex();
    }
}

WorkflowStateTrait sample

#
Method NULL Default Ex Type
1 stateIndex($page = 10) Y 10 $page=10 Integer
2 stateCreate() Y - - -
3 stateStore($request,= array()) N - $request->all() Array
4 stateEdit($id) N -
$id = 1
Integer
5 stateUpdate($request= array(), $id) N -
$request->all()
$id = 1
Array
6 stateActive($id) N - $id = 1
Integer
7 stateDeActive($id) N - $id = 1
Integer

WorkflowTransitionTrait sample

#
Method NULL Default Ex Type
1 transitionIndex($page = 10) Y 10 $page=10 Integer
2 transitionCreate() Y - - -
3 transitionStore($request = array()) N - $request->all() Array
4 transitionEdit($id) N -
$id = 1
Integer
5 transitionUpdate($request = array(), $id) N -
$request->all()
$id = 1
Array
6 transitionActive($id) N - $id = 1
Integer
7 transitionDeActive($id) N - $id = 1
Integer

Contoh 2

pada aplikasi yang digunakan

//Controller
use Bantenprov\Workflow\Workflow
...
public function SOMETHING()
{
    $id = 1;
    return \Workflow::getStateName($id);
}
//Controller
use Bantenprov\Workflow\Workflow
...
public function SOMETHING()
{
    $id = 1;
    return \Workflow::getTransitionName($id);
}

CSS

folder style.css : public/css/style.css

<!-- layout.blade.php -->
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">        
        <title>Laravel</title>

        <!-- Fonts -->
  -->   <link href="{{ asset('css/workflow_style.css') }}" rel="stylesheet" type="text/css">

JS

folder custom.js : public/js/custom.js

<!-- layout.blade.php -->
          
            </div>
        </div>
  -->   <script src="{{ asset('js/workflow_javascript.js') }}"></script>
    </body>
</html>

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固