Skip to content

Commit 378d975

Browse files
Merge pull request #97 from TheDragonCode/3.x
Update docs
2 parents a8e52c1 + 920394a commit 378d975

File tree

2 files changed

+65
-33
lines changed

2 files changed

+65
-33
lines changed

docs/how-to-use/running.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ To run all of your outstanding actions, execute the `migrate:actions` artisan co
66
php artisan migrate:actions
77
```
88

9+
Action call order is checked by filename without path:
10+
11+
```bash
12+
2022_10_14_000001_test1 # 1
13+
2022_10_14_000004_test4 # 4
14+
bar/2022_10_14_000003_test3 # 3
15+
foo/2022_10_14_000002_test2 # 2
16+
```
17+
18+
```bash
19+
2022_10_14_000001_test1 # 1
20+
foo/2022_10_14_000002_test2 # 2
21+
bar/2022_10_14_000003_test3 # 3
22+
2022_10_14_000004_test4 # 4
23+
```
24+
925
## Split Launch Option
1026

1127
Sometimes it becomes necessary to launch actions separately, for example, to notify about the successful deployment of a project.

docs/prologue/upgrade.md

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,27 @@
22

33
## High Impact Changes
44

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)
1111
- Laravel 6.0 was dropped
1212
- Dragon Code: Contracts (`dragon-code/contracts`) was dropped
13-
- Added property typing
1413

1514
## Medium Impact Changes
1615

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)
1918

2019
## Upgrading To 3.x from 2.x
2120

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-
3421
### Call Upgrade Command
3522

23+
> Note
24+
> If you used inheritance of actions from other actions, then you will need to process these files manually.
25+
3626
For your convenience, we have created an upgrade console command:
3727

3828
```bash
@@ -47,12 +37,21 @@ It will do the following:
4737
- Replace named classes with anonymous ones
4838
- Create a configuration file according to the data saved in your project
4939

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`
5251

5352
### Configuration
5453

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`.
5655

5756
```bash
5857
php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider"
@@ -62,7 +61,6 @@ php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider
6261

6362
Move the action files to the `actions` folder in the project root, or update the `actions.path` option in the configuration file.
6463

65-
6664
### Parent Namespace
6765

6866
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
9189

9290
### Changed Migration Repository
9391

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.
9593

96-
### Added property typing
94+
### Changed Properties
9795

9896
Make sure all overridden properties are typed:
9997

10098
```
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
107123
```

0 commit comments

Comments
 (0)