the42coders / workflows
This Package allows you to automate your Laravel Application from your Backend.
Installs: 1 882
Dependents: 0
Suggesters: 0
Security: 0
Stars: 255
Watchers: 17
Forks: 66
Open Issues: 4
Language:JavaScript
Requires
- php: >7.2
- barryvdh/laravel-dompdf: ^0.9.0|^1.0|^2.0
- doctrine/dbal: ^3.4
- guzzlehttp/guzzle: ^7
- illuminate/support: *
Requires (Dev)
- dev-master
- 0.0.19
- 0.0.18
- 0.0.17
- 0.0.16
- 0.0.15
- 0.0.14
- 0.0.13
- 0.0.12
- 0.0.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7-beta
- 0.0.6-beta
- 0.0.5-beta
- v0.0.4-beta
- v0.0.3-beta
- v0.0.2-beta
- v0.0.1-beta
- dev-analysis-RPwWwK
- dev-delete_triggers_and_tasks_with_workflows
- dev-analysis-0gNjPM
- dev-analysis-PxP69m
- dev-analysis-e7gok9
- dev-feature/newTaskStringInput
- dev-feature/newTaskSlackMessage
- dev-analysis-VrmkbK
- dev-feature/newTaskLoadModel
- dev-analysis-rdo3d1
- dev-feature/buttonTrigger
- dev-analysis-9m6Vrw
- dev-analysis-gOy2w4
- dev-bugfix/fix-migration-down
This package is auto-updated.
Last update: 2024-12-24 09:19:50 UTC
README
The Workflow Package adds Drag & Drop Workflows to your Laravel Application. A Workflow consists of Triggers and Tasks. The Trigger is responsible for starting a Workflow. The Tasks are single nodes of code execution. The package comes with some handy tasks bundled, but you can easily write your own as well.
If you are interested in news and updates
- Follow me on Twitter && || register to our Newsletter
Installation
You can install the package via composer:
composer require the42coders/workflows
You need to register the routes to your web.php routes File as well. Since the Workflow Package is very powerful make sure to secure the routes with whatever authentication you use in the rest of your app.
Route::group(['middleware' => ['auth']], function () { \the42coders\Workflows\Workflows::routes(); });
You need to publish the assets of the Package
php artisan vendor:publish --provider="the42coders\Workflows\WorkflowsServiceProvider" --tag=assets
Other publishable Contents are
config
php artisan vendor:publish --provider="the42coders\Workflows\WorkflowsServiceProvider" --tag=config
language
php artisan vendor:publish --provider="the42coders\Workflows\WorkflowsServiceProvider" --tag=lang
views
php artisan vendor:publish --provider="the42coders\Workflows\WorkflowsServiceProvider" --tag=views
Usage
The Workflow Package is working out of the Box in your Laravel application. Just go to the route /workflows to get started.
Workflows
A Workflow is gets started by a Trigger and then executes the Tasks in the Order you set them. To pass information between the Tasks we have the DataBus.
Triggers
A Trigger is the Starting Point and defines how a Workflow gets called. More Triggers coming soon.
ObserverTrigger
The Observer Trigger can listen to Eloquent Model Events and will then pass the Model which triggered the Event to the Workflow.
To make it Work add the WorkflowObservable to your Eloquent Model.
use WorkflowObservable;
ButtonTrigger
The Button Trigger is able to render a button in your "frontend" and Execute a Workflow based by a click on it. ButtonTrigger also accept an Model which they pass to the Workflow.
You can influence the buttons by adding your own classes or styles directly to each ButtonTrigger. Also you can publish the blade and change it according to your needs.
You have multiple ways of rendering ButtonTrigger.
ByName
{!! the42coders\Workflows\Triggers\ButtonTrigger::renderButtonByName('name', $model) !!}
ByWorkflowId
{!! the42coders\Workflows\Triggers\ButtonTrigger::renderButtonByWorkflowId(workflow_id, $model) !!}
ByCategory
This will return all Triggers from the Category.
{!! the42coders\Workflows\Triggers\ButtonTrigger::renderButtonsByCategory('categoryName', $model) !!}
Tasks
A Task is a single code execution Node in the Workflow.
SendSlackMessage
To send Slack messages you need to follow this 3 points.
- You need to install Slack notifications Laravel Slack Documentation
- You need to set up an incoming Slack Webhook Slack Documentation
- Set the WebhookUrl to your env file with WORKFLOW_SLACK_CHANNEL=YourSlackWebhookUrl
DataBus
The DataBus is a way to pass information between the single Tasks. This keeps the Tasks independent of each other.
Testing
composer test
Changelog
Please see CHANGELOG for more information about what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email max@42coders.com instead of using the issue tracker.
Credits
- Max Hutschenreiter
- All Contributors
- jerosoler for Drawflow
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.