Giter VIP home page Giter VIP logo

workflow-1's Introduction

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:

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/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>

workflow-1's People

Contributors

ahmadlab avatar andri-sudarmawijaya avatar bantenprov avatar feripratama avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.