2
2
3
3
## High Impact Changes
4
4
5
- - Replacing named classes with anonymous ones
6
- - Change the location of the configuration file
7
- - Changing the namespace of the parent class
8
- - Changing variable names from ` snake_case ` to ` camelCase `
9
- - Added recursive search for actions in a folder
10
- - PHP 7.3 and 7.4 was dropped
5
+ - [ Change the location of the configuration file ] ( #configuration )
6
+ - [ Replacing named classes with anonymous ones ] ( #anonymous-classes )
7
+ - [ Changing the namespace of the parent class] ( #parent-namespace )
8
+ - [ Changing variable names from ` snake_case ` to ` camelCase ` and added typing ] ( #changed-properties )
9
+ - [ Added recursive search for actions in a folder] ( #added-recursive-search-for-actions-in-a-folder )
10
+ - [ PHP 7.3 and 7.4 was dropped] ( #php-802-required )
11
11
- Laravel 6.0 was dropped
12
12
- Dragon Code: Contracts (` dragon-code/contracts ` ) was dropped
13
- - Added property typing
14
13
15
14
## Medium Impact Changes
16
15
17
- - Changing the name of an action column in the database
18
- - Action storage directory changed
16
+ - [ Changing the name of an action column in the database] ( #changed-migration-repository )
17
+ - [ Action storage directory changed] ( #actions-location )
19
18
20
19
## Upgrading To 3.x from 2.x
21
20
22
- ### Updating Dependencies
23
-
24
- #### PHP 8.0.2 Required
25
-
26
- Laravel Actions now requires PHP 8.0.2 or greater.
27
-
28
- #### Composer Dependencies
29
-
30
- You should update the following dependency in your application's ` composer.json ` file:
31
-
32
- - ` dragon-code/laravel-migration-actions ` to ` ^3.0 `
33
-
34
21
### Call Upgrade Command
35
22
23
+ > Note
24
+ > If you used inheritance of actions from other actions, then you will need to process these files manually.
25
+
36
26
For your convenience, we have created an upgrade console command:
37
27
38
28
``` bash
@@ -47,12 +37,21 @@ It will do the following:
47
37
- Replace named classes with anonymous ones
48
38
- Create a configuration file according to the data saved in your project
49
39
50
- > Note
51
- > If you used inheritance of actions from other actions, then you will need to process these files manually.
40
+ ### Updating Dependencies
41
+
42
+ #### PHP 8.0.2 Required
43
+
44
+ Laravel Actions now requires PHP 8.0.2 or greater.
45
+
46
+ #### Composer Dependencies
47
+
48
+ You should update the following dependency in your application's ` composer.json ` file:
49
+
50
+ - ` dragon-code/laravel-migration-actions ` to ` ^3.0 `
52
51
53
52
### Configuration
54
53
55
- Publish the config file and migrate the settings from the ` config/database.php ` file.
54
+ Publish the config file and migrate the settings from the ` config/database.php ` file to ` config/actions.php ` .
56
55
57
56
``` bash
58
57
php artisan vendor:publish --provider=" DragonCode\LaravelActions\ServiceProvider"
@@ -62,7 +61,6 @@ php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider
62
61
63
62
Move the action files to the ` actions ` folder in the project root, or update the ` actions.path ` option in the configuration file.
64
63
65
-
66
64
### Parent Namespace
67
65
68
66
Replace ` DragonCode\LaravelActions\Support\Actionable ` with ` DragonCode\LaravelActions\Action ` .
@@ -91,17 +89,35 @@ If your class does not contain a `down` method, then you can replace the `up` me
91
89
92
90
### Changed Migration Repository
93
91
94
- Just call the ` php artisan migrate ` command to make changes to the action repository table.
92
+ Just call the ` php artisan migrate ` command to make changes to the action repository table.
95
93
96
- ### Added property typing
94
+ ### Changed Properties
97
95
98
96
Make sure all overridden properties are typed:
99
97
100
98
```
101
- protected $once >> protected bool $once
102
- protected $transactions >> protected bool $transactions
103
- protected $transactionAttempts >> protected int $transactionAttempts
104
- protected $environment >> protected string|array|null $environment
105
- protected $exceptEnvironment >> protected string|array|null $exceptEnvironment
106
- protected $before >> protected bool $before
99
+ protected $once >> protected bool $once
100
+ protected $transactions >> protected bool $transactions
101
+ protected $transaction_attempts >> protected int $transactionAttempts
102
+ protected $environment >> protected string|array|null $environment
103
+ protected $except_environment >> protected string|array|null $exceptEnvironment
104
+ protected $before >> protected bool $before
105
+ ```
106
+
107
+ ### Added recursive search for actions in a folder
108
+
109
+ #### Before:
110
+
111
+ ``` bash
112
+ 2022_10_13_013321_test1
113
+ 2022_10_13_013326_test2
114
+ bar/2022_10_13_013323_test3 # will not be called
115
+ ```
116
+
117
+ #### After:
118
+
119
+ ``` bash
120
+ 2022_10_13_013321_test1
121
+ 2022_10_13_013326_test2
122
+ bar/2022_10_13_013323_test3 # will be called
107
123
```
0 commit comments