Skip to content

Commit 0594576

Browse files
Update upgrade.md
1 parent 56794b9 commit 0594576

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/prologue/upgrade.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,49 @@ It will do the following:
4545
- Replace the `up` method with `__invoke` if the class does not have a `down` method
4646
- Replace named classes with anonymous ones
4747
- Create a configuration file according to the data saved in your project
48+
49+
> Note
50+
> If you used inheritance of actions from other actions, then you will need to process these files manually.
51+
52+
### Configuration
53+
54+
Publish the config file and migrate the settings from the `config/database.php` file.
55+
56+
```bash
57+
php artisan vendor:publish --provider="DragonCode\LaravelActions\ServiceProvider"
58+
```
59+
60+
### Actions Location
61+
62+
Move the action files to the `actions` folder in the project root, or update the `actions.path` option in the configuration file.
63+
64+
65+
### Parent Namespace
66+
67+
Replace `DragonCode\LaravelActions\Support\Actionable` with `DragonCode\LaravelActions\Action`.
68+
69+
### Anonymous Classes
70+
71+
Replace named calls to your application's classes with anonymous ones.
72+
73+
For example:
74+
75+
```php
76+
// before
77+
use DragonCode\LaravelActions\Support\Actionable;
78+
79+
class Some extends Actionable {}
80+
81+
// after
82+
use DragonCode\LaravelActions\Action;
83+
84+
return new class () extends Action {};
85+
```
86+
87+
### Invokable Method
88+
89+
If your class does not contain a `down` method, then you can replace the `up` method with `__invoke`.
90+
91+
### Changed Migration Repository
92+
93+
Just call the `php artisan migrate` command to make changes to the action repository table.

0 commit comments

Comments
 (0)