Download the PHP package maestrodimateo/laravel-workflow without Composer

On this page you can find all versions of the php package maestrodimateo/laravel-workflow. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-workflow

Laravel Workflow

Latest Version on Packagist License

A visual, configurable workflow engine for Laravel. Define circuits (workflow definitions), baskets (steps), and transitions — then move any Eloquent model through them with a clean Facade API.

Comes with a built-in visual admin interface to design your workflows by drag-and-drop.


Features

Requirements


Installation

Publish the config and migrations:

Optionally publish the views to customize the admin UI:


Quick Start

1. Add the trait to your model

When an Invoice is created, it's automatically placed in the DRAFT basket of the circuit targeting it.

2. Open the visual designer

Navigate to /workflow/admin in your browser. From there you can:

3. Transition models in your code

The workflow() helper is also available:


Facade API Reference

All methods are available via Workflow:: or workflow()->.

Model-bound methods

These methods require Workflow::for($model) first:

Method Returns Description
in($circuit) WorkflowManager Scope to a specific circuit (required for multi-circuit)
currentStatus() ?Basket Current basket (step) of the model
nextBaskets() Collection Available baskets to transition to
transition($id, $comment) bool Move the model to the next basket
history() Collection Full transition history with durations
totalDuration() int Total processing time in seconds
durationInStatus($status) int Time spent in a specific status (seconds)
allStatuses() array Current basket per circuit
circuits() Collection All circuits the model belongs to
lock($minutes) WorkflowLock Lock the model for exclusive access
unlock($force) void Release the lock
isLocked() bool Check if locked
isLockedByMe() bool Check if locked by the current user
lockedBy() ?string User ID holding the lock
lockExpiration() ?Carbon When the lock expires
requiredDocuments($basketId) array Documents required for a transition
requirements() array All requirements for all next transitions

Static methods

These methods don't require for():

Method Returns Description
importFromJson($path) Circuit Import a circuit from an exported JSON file (for seeders/commands)
registerAction($class) void Register a custom transition action
getRegisteredActions() array List all registered action classes

Role-based queries

These methods don't require for():

Eloquent scopes are also available directly:


Duration Tracking

Every transition automatically records the time spent in the previous step:

Human-readable formats: 45s, 12min, 2h 35min, 3j 4h.


Multi-Circuit Support

A model can belong to multiple circuits simultaneously. Use in() to scope operations:

When a model is created, it's automatically attached to the DRAFT basket of every circuit targeting its class.


Resource Locking

Prevent multiple operators from working on the same model simultaneously:

Query scopes

Handling lock exceptions

Configure the default lock duration in .env:


Transition Actions

Actions are executed automatically when a specific transition occurs. They are configured visually in the admin UI.

Built-in actions

Action Key Config
Send email send_email Select a message from the circuit
Log log Optional message
Webhook webhook URL to POST to
Require documents require_document List of documents (type + label)

Custom actions

Generate a new action with artisan:

This creates app/Workflow/Actions/GeneratePdfAction.php:

Register it in your AppServiceProvider::boot():

The action immediately appears in the admin UI's "Add action" menu on any transition.


Events

A TransitionEvent is fired after every transition. Add your own listeners:

What happens during a transition


Message Templates

Messages are created at the circuit level and can be used in transition actions (e.g., send_email).

The WYSIWYG editor supports variable interpolation:

Built-in variables

Variable Description
{{ model_id }} Model identifier
{{ model_type }} Model class name
{{ from_status }} / {{ from_name }} Source basket
{{ to_status }} / {{ to_name }} Target basket
{{ circuit_name }} Circuit name
{{ date }} / {{ heure }} / {{ datetime }} Current date/time
{{ user }} User performing the transition

Custom variables


Export / Import

In the admin UI

Via API

Programmatic import (seeders, commands)

Import a previously exported JSON file directly from code — no HTTP request needed:

The method creates the full circuit (baskets, transitions, messages) inside a database transaction and returns the newly created Circuit instance with all relations loaded.

Throws \InvalidArgumentException if the file is missing or has an invalid format.


Configuration


Workflowable Trait

The Workflowable trait adds relations, methods, and scopes directly on your model instance. Everything below is available without using the Facade.

Relations

Methods

Scopes

Automatic Behavior

When a model is created, it's automatically attached to the DRAFT basket of every circuit targeting its class:


Admin Interface

The visual designer at /workflow/admin provides:


Testing

Or with Pest directly:


License

MIT. See LICENSE for details.


Credits


All versions of laravel-workflow with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3 || ^8.4
illuminate/database Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/events Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package maestrodimateo/laravel-workflow contains the following files

Loading the files please wait ...