Download the PHP package jasperfernandez/laraflow without Composer

On this page you can find all versions of the php package jasperfernandez/laraflow. 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 laraflow

jasperfernandez/laraflow

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Laraflow is a workflow engine for Laravel applications. It lets you define workflow templates with ordered steps, assign roles to each step, configure allowed actions, and run workflow instances against any Eloquent model.

It is a good fit for application flows such as membership approvals, onboarding, request routing, document review, or any process that needs step history, assignments, status transitions, and audit trails.

Installation

Install the package with Composer:

Publish and run the package migrations:

Publish the config file:

Before You Start

Laraflow manages workflow templates, workflow instances, workflow steps, assignments, and transitions. Your application is responsible for the domain records that Laraflow references:

By default, the package checks whether the acting user can execute a step by calling hasRole(string $role) on the authenticated user model. If your user model does not expose that method, the default authorization will deny the action.

Configuration

After publishing the config, point the package at your own role, status, and action models:

Your application models should provide these fields:

Defining A Workflow

A workflow is defined with four main records:

  1. A WorkflowTemplate
  2. One or more WorkflowTemplateStep records
  3. One or more WorkflowTemplateStepAssignment records that assign roles to each step
  4. One or more WorkflowTemplateStepAction records that define which actions are allowed and where they lead

Example:

Starting A Workflow

Use WorkflowEngine::start() to create a workflow instance for any Eloquent model:

When a workflow starts, Laraflow:

Applying An Action

Use WorkflowEngine::apply() to execute an action on the current step:

The returned TransitionResult includes:

Authorization

The default authorization strategy is role-based. The package checks the assigned role names on the current step and calls hasRole() on the actor.

Example:

If you want a different authorization strategy, bind your own implementation of JasperFernandez\Laraflow\Contracts\WorkflowAuthorization in your application container.

End-To-End Example

Subject Integration

To easily manage workflows on your models, use the HasWorkflows trait:

Events

Laraflow dispatches the following events during the workflow lifecycle:

Event Dispatched When
WorkflowStarted A new workflow instance is initialized.
WorkflowTransitioned An action is successfully applied to a step.
WorkflowClosed A workflow instance is marked as closed.

You can listen to these events in your EventServiceProvider:

Notes

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see LICENSE.md for more information.


All versions of laraflow with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^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 jasperfernandez/laraflow contains the following files

Loading the files please wait ...