You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+56-46Lines changed: 56 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,21 @@ This is a fork from [brexis/laravel-workflow](https://github.com/brexis/laravel-
4
4
5
5
Use the Symfony Workflow component in Laravel
6
6
7
-
###Installation
7
+
## Installation
8
8
9
9
composer require zerodahero/laravel-workflow
10
10
11
-
#### Right now, I've bumped the dependencies up to active PHP version (>=7.2), so in Laravel >= 5.5, use the package auto-discovery
12
-
#### For laravel <= 5.4 (Deprecated)
11
+
## Upgrade from v2 to v3
12
+
13
+
The biggest changes from v2 to v3 are the dependencies. To match the Symfony v5 components, the Laravel version is raised to v7. If you're on Laravel v6 or earlier, you should continue to use the v2 releases of this package.
14
+
15
+
To match the changes in the Symfony v5 workflow component, the "arguments" config option has been changed to "property". This describes the property on the model the workflow ties to (in most circumstances, you can simply change the key name from "arguments" to "property", and set to a string instead of the previous array).
16
+
17
+
Also, the "initial_place" key has been changed to "initial_places" to align with the Symfony component as well.
18
+
19
+
### Non-package Discovery
20
+
21
+
If you aren't using package discovery:
13
22
14
23
Add a ServiceProvider to your providers array in `config/app.php`:
15
24
@@ -31,7 +40,7 @@ Add the `Workflow` facade to your facades array:
Once you have the underlying Symfony workflow component, you can do anything you want, just like you would in Symfony. A couple examples are provided below, but be sure to take a look at the [Symfony docs](https://symfony.com/doc/current/workflow.html) to better understand what's going on here.
191
+
## Symfony Workflow Usage
192
+
Once you have the underlying Symfony workflow component, you can do anything you want, just like you would in Symfony. A couple examples are provided below, but be sure to take a look at the [Symfony docs](https://symfony.com/doc/current/workflow.html) to better understand what's going on here.
183
193
184
194
```php
185
195
<?php
@@ -328,7 +338,7 @@ class BlogPostWorkflowSubscriber
If you are loading workflow definitions through some dynamic means (perhaps via DB), you'll most likely want to turn on registry tracking. This will enable you to see what has been loaded, to prevent or ignore duplicate workflow definitions.
396
406
@@ -410,7 +420,7 @@ return [
410
420
411
421
/**
412
422
* Only used when track_loaded = true
413
-
*
423
+
*
414
424
* When set to true, a registering a duplicate workflow will be ignored (will not load the new definition)
415
425
* When set to false, a duplicate workflow will throw a DuplicateWorkflowException
416
426
*/
@@ -443,27 +453,27 @@ You can dynamically load a workflow by using the `addFromArray` method on the wo
0 commit comments