Download the PHP package tschucki/filament-workflows without Composer
On this page you can find all versions of the php package tschucki/filament-workflows. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tschucki/filament-workflows
More information about tschucki/filament-workflows
Files in tschucki/filament-workflows
Package filament-workflows
Short Description Add workflows to your filament app
License MIT
Homepage https://github.com/tschucki/filament-workflows
Informations about the package filament-workflows
Add workflows to your filament app
This plugin lets you add workflows to your filament app. You can attach triggers and dispatchable actions to your workflows. The plugin will automatically execute the actions when the trigger conditions are met.
Table of Contents
- Images
- Installation
- Usage
- Basics
- Add the trait to your model
- Create an Action
- Configuration
- Define searchable field
- Max Search Results
- Testing
- Changelog
- Contributing
- Security Vulnerabilities
- Credits
- License
Images
Installation
You can install the package via composer:
You can install the plugin using:
You can publish and run the migrations manually with:
Register the plugin in your AdminPanelServiceProvider
:
Usage
Basics
In order to let your models use workflows, you need to add the InteractsWithWorkflows
trait to your model. By adding this trait, the plugin will automatically add a global observer to your model. So when ever a workflow matches the event and trigger conditions, the workflow will execute the actions.
Add the trait to your model
Create an Action
In order to attach an action to your workflows, you will have to create a class within the App\Jobs\Actions
folder. The class must extend the BaseAction
class. This requires you to implement the handle
method. This method will be called when the workflow is executed.
The action class is very similar to a job.
When ever the action get executed, the model will be passed to the __construct
method. You can use the model to do whatever you want.
The plugin will find this class on its own. So you don't have to register it anywhere.
That's it. Now you can create and attach actions to your workflows.
Configuration
Define searchable field
If you don't just want to search for the id
, you can use the function getTitleColumnForWorkflowSearch
within your model to search in another field as well.
Max Search Results
In case you want to change the max search results for the models, you can publish the config file and change the workflows.search.max_results
value (defaults to 100).
This can come in handy when you have a lot of models and the search is slow.
Use Custom Models and Resources
If you want to use custom models and resources, you can publish the config file and change the workflows.models
and workflows.resources
values. It is highly recommended that custom models and resources extend the existing Workflow classes.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Marcel Wagner
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of filament-workflows with dependencies
filament/filament Version ^3.0
spatie/laravel-package-tools Version ^1.15.0