Skip to content

Commit 597cca9

Browse files
Merge pull request #121 from TheDragonCode/4.x
Update upgrade docs
2 parents 91d19ab + 2968564 commit 597cca9

File tree

6 files changed

+112
-21
lines changed

6 files changed

+112
-21
lines changed

docs/.vuepress/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = {
3636
editLink: true,
3737

3838
navbar: [
39-
{ text: '3.x', link: '/prologue/changelog/index.md' }
39+
{ text: '4.x', link: '/prologue/changelog/4.x.md' }
4040
],
4141

4242
sidebarDepth: 1,

docs/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
## Table of contents
1515

1616
* Prologue
17-
* [Upgrade Guide](prologue/upgrade.md)
17+
* [Upgrade Guide](prologue/upgrade-guide/index.md)
18+
* [To 4.x from 3.x](prologue/upgrade-guide/4.x.md)
19+
* [To 3.x from 2.x](prologue/upgrade-guide/3.x.md)
1820
* Getting Started
1921
* [Installation](getting-started/installation/index.md)
2022
* How to use

docs/prologue/changelog/4.x.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
### Changed
66

7-
- Coming soon
7+
- Project renamed from `Laravel Migration Actions` to `Laravel Actions` by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/108
8+
- Console commands have been renamed by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/110
9+
- `Names::MIGRATE` constant have been renamed to `Names::ACTIONS` by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/111
10+
- Refactored `actions:upgrade` console command by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/112
11+
- Renamed console class name by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/113
12+
- Database table name changed from `migration_actions` to `actions` by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/114
13+
- Changelog prepared for version 4 by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/115
14+
- Renamed `migrate` methods with `actions` by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/116
15+
- Added Events tests by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/117
16+
- Fixed conflict block by @andrey-helldar in https://github.com/TheDragonCode/laravel-actions/pull/120
817

918
**Full Changelog**: https://github.com/TheDragonCode/laravel-actions/compare/v3.2.0...v4.0.0

docs/prologue/upgrade.md renamed to docs/prologue/upgrade-guide/3.x.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Upgrade Guide
1+
# Upgrading To 3.x from 2.x
22

3-
## High Impact Changes
3+
### High Impact Changes
44

55
- [Change the location of the configuration file](#configuration)
66
- [Replacing named classes with anonymous ones](#anonymous-classes)
@@ -11,13 +11,11 @@
1111
- Laravel 6.0 was dropped
1212
- Dragon Code: Contracts (`dragon-code/contracts`) was dropped
1313

14-
## Medium Impact Changes
14+
### Medium Impact Changes
1515

1616
- [Changing the name of an action column in the database](#changed-action-repository)
1717
- [Action storage directory changed](#actions-location)
1818

19-
## Upgrading To 3.x from 2.x
20-
2119
### Call Upgrade Command
2220

2321
> Note
@@ -37,35 +35,35 @@ It will do the following:
3735
- Replace named classes with anonymous ones
3836
- Create a configuration file according to the data saved in your project
3937

40-
### Updating Dependencies
38+
## Updating Dependencies
4139

42-
#### PHP 8.0.2 Required
40+
### PHP 8.0.2 Required
4341

4442
Laravel Actions now requires PHP 8.0.2 or greater.
4543

46-
#### Composer Dependencies
44+
### Composer Dependencies
4745

4846
You should update the following dependency in your application's `composer.json` file:
4947

5048
- `dragon-code/laravel-actions` to `^3.0`
5149

52-
### Configuration
50+
## Configuration
5351

5452
Publish the config file and migrate the settings from the `config/database.php` file to `config/actions.php`.
5553

5654
```bash
5755
php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider"
5856
```
5957

60-
### Actions Location
58+
## Actions Location
6159

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

64-
### Parent Namespace
62+
## Parent Namespace
6563

6664
Replace `DragonCode\LaravelActions\Support\Actionable` with `DragonCode\LaravelActions\Action`.
6765

68-
### Anonymous Classes
66+
## Anonymous Classes
6967

7068
Replace named calls to your application's classes with anonymous ones.
7169

@@ -83,15 +81,15 @@ use DragonCode\LaravelActions\Action;
8381
return new class () extends Action {};
8482
```
8583

86-
### Invokable Method
84+
## Invokable Method
8785

8886
If your class does not contain a `down` method, then you can replace the `up` method with `__invoke`.
8987

90-
### Changed Action Repository
88+
## Changed Action Repository
9189

9290
Just call the `php artisan migrate` command to make changes to the action repository table.
9391

94-
### Changed Properties
92+
## Changed Properties
9593

9694
Make sure all overridden properties are typed:
9795

@@ -104,17 +102,17 @@ protected $except_environment >> protected string|array|null $exceptEnvironm
104102
protected $before >> protected bool $before
105103
```
106104

107-
### Added recursive search for actions in a folder
105+
## Added recursive search for actions in a folder
108106

109-
#### Before:
107+
### Before:
110108

111109
```bash
112110
2022_10_13_013321_test1
113111
2022_10_13_013326_test2
114112
bar/2022_10_13_013323_test3 # will not be called
115113
```
116114

117-
#### After:
115+
### After:
118116

119117
```bash
120118
2022_10_13_013321_test1

docs/prologue/upgrade-guide/4.x.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Upgrading To 4.x from 3.x
2+
3+
### High Impact Changes
4+
5+
- [Renamed project namespace](#renamed-project-namespace)
6+
- [Changing the names of console commands](#changing-the-names-of-console-commands)
7+
8+
### Medium Impact Changes
9+
10+
- [`Names::MIGRATE` constant name changed](#namesmigrate-constant-name-changed)
11+
12+
### Low Impact Changes
13+
14+
- [Changed the default name of the table for storing actions](#changed-the-default-name-of-the-table-for-storing-actions)
15+
16+
## Renamed project namespace
17+
18+
You should update the following dependency in your application's `composer.json` file:
19+
20+
Replace:
21+
22+
```json
23+
{
24+
"require": {
25+
"dragon-code/laravel-migration-actions": "^3.0"
26+
}
27+
}
28+
```
29+
30+
with
31+
32+
```json
33+
{
34+
"require": {
35+
"dragon-code/laravel-actions": "^4.0"
36+
}
37+
}
38+
```
39+
40+
Then you need to update the dependencies:
41+
42+
```bash
43+
composer update
44+
```
45+
46+
## Changing the names of console commands
47+
48+
| Old Name | New Name |
49+
|----------------------------------------|--------------------------------|
50+
| `php artisan make:migration:action` | `php artisan make:action` |
51+
| `php artisan migrate:actions` | `php artisan actions` |
52+
| `php artisan migrate:actions:install` | `php artisan actions:install` |
53+
| `php artisan migrate:actions:fresh` | `php artisan actions:fresh` |
54+
| `php artisan migrate:actions:refresh` | `php artisan actions:refresh` |
55+
| `php artisan migrate:actions:reset` | `php artisan actions:reset` |
56+
| `php artisan migrate:actions:rollback` | `php artisan actions:rollback` |
57+
| `php artisan migrate:actions:status` | `php artisan actions:status` |
58+
| `php artisan migrate:actions:upgrade` | `php artisan actions:upgrade` |
59+
60+
## `Names::MIGRATE` constant name changed
61+
62+
Replace
63+
64+
```php
65+
DragonCode\LaravelActions\Constants\Names::MIGRATE
66+
```
67+
68+
with
69+
70+
```php
71+
DragonCode\LaravelActions\Constants\Names::ACTIONS
72+
```
73+
74+
## Changed the default name of the table for storing actions
75+
76+
The new table name is `actions`.
77+
78+
You can also specify any name in the application [settings](https://github.com/TheDragonCode/laravel-actions/blob/main/config/actions.php).

docs/prologue/upgrade-guide/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Upgrade Guide
2+
3+
* [Upgrading To 4.x from 3.x](4.x.md)
4+
* [Upgrading To 3.x from 2.x](3.x.md)

0 commit comments

Comments
 (0)