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 for easily manage states and transitions in a complex business prosess.
The final of this package will be contained some awesome feature:
- Define a name and descriotion of the workflow, each conte type could containt more then one workflow to manage their business process
- Define a collection of state name in worflow related, and describe the latest status the content in a business process
- Define a transition of any state in content, this feature will be handle move transition
- Guard give a permission to manage one or any authorization of the role management to the transition related
- 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.
See TODO before use this.
Demo site for this packages is available here : Workflow.
$ composer create-project --prefer-dist laravel/laravel project-name "5.4.*"
$ composer require bantenprov/workflow "1.0.0"
'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' => [
...
'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,
$ 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
use Bantenprov\Workflow\Traits\WorkflowStateTrait;
class WorkflowStateController extends Controller
{
use WorkflowStateTrait;
public function index()
{
return WorkflowStateTrait::stateIndex();
}
}
use Bantenprov\Workflow\Traits\WorkflowTransitionTrait;
class WorkflowTransitionController extends Controller
{
use WorkflowTransitionTrait;
public function index()
{
return WorkflowStateTrait::transitionIndex();
}
}
# |
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 |
# |
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 |
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);
}
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">
folder custom.js : public/js/custom.js
<!-- layout.blade.php -->
</div>
</div>
--> <script src="{{ asset('js/workflow_javascript.js') }}"></script>
</body>
</html>