Download the PHP package tomatophp/filament-workflows without Composer

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

Screenshot

Filament Workflows Builder

Latest Stable Version License Downloads

Build automation workflows from your Filament panel. A workflow is made of triggers: a model being created, updated or deleted, an application event being dispatched, or a webhook being called. Each trigger runs the actions you attach to it (PHP classes you register), and every run is written to the workflow logs.

Screenshots

Workflows Workflows Dark Builder Builder Dark Triggers Triggers Dark Workflow Logs Workflow Logs Dark

Features

Compatibility

Package Filament Laravel PHP
5.x 5.x 12 / 13 8.2+
1.x 3.x 10 / 11 8.1+

Installation

After installing the package run the install command (it runs the migrations):

Finally register the plugin in /app/Providers/Filament/AdminPanelProvider.php:

Usage

Everything is registered from a service provider, for example in AppServiceProvider::boot().

Register models

Add the InteractsWithWorkflow trait to every model that can trigger a workflow:

The trait fires the model triggers on created, updated and deleted. It also adds the model to the trigger "Model" list, but only once the model class has been used in the request, so register it explicitly as well to always see it in the builder:

Register events

Any event class can be used as a trigger. Registered events are listened to automatically; the event public properties are the trigger payload (used by the where condition and stored in the log):

Create actions

An action is a class that extends TomatoPHP\FilamentWorkflows\Services\Abstracts\Action. run() receives the event that fired the trigger and the TriggerHasAction row, whose payload holds the settings filled in the form() fields on the builder page. Return an empty array from form() when the action has no settings.

Register it so it shows up in the action "Runs" list:

The event passed to run() is Events\Models\ModelCreated, ModelUpdated or ModelDeleted for model triggers ($event->data is the model, $event->trigger the trigger), Events\Webhook\WebhookEvent for webhooks ($event->data is the request input) and your own event object for event triggers.

Actions run synchronously while the trigger fires. Dispatch a queued job from run() for slow work. Only classes extending Services\Abstracts\Action are executed, and an exception thrown by an action is reported and logged without stopping the other actions.

Build a workflow

  1. Create a workflow and switch it to Active (inactive workflows never run).
  2. Click Build on the workflow row.
  3. Create Trigger (or attach an existing one), choose the type and, optionally, a where / is / value condition (for example status = paid).
  4. On the trigger, Create Action (or attach an existing one) and pick the class it runs. Use the gear button to fill the action settings.

Every run shows up in the Workflow Logs resource and under the workflow on the builder page.

Webhooks

Set a token in your .env. While it is empty the webhook endpoint answers 403 to every request:

Then call GET or POST /workflows/webhook (route name workflows.webhook) with the token as the token parameter or the X-Workflow-Token header. A webhook trigger runs when the request input contains the key saved in the trigger "Webhook key" field:

The token is compared in constant time, removed from the payload before it is logged, and the route is throttled to 60 requests per minute. The endpoint does not use the web middleware group, so no session or CSRF token is needed.

Publish Assets

You can publish the config file with:

You can publish the views with:

You can publish the language files with:

You can publish the migrations with:

Testing

Changelog

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

Security

Please see SECURITY for more information about security.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of filament-workflows with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
tomatophp/console-helpers Version ^1.1
filament/filament Version ^5.0
tomatophp/filament-icons Version ^5.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 tomatophp/filament-workflows contains the following files

Loading the files please wait ...