Upgrading To 6.x from 5.x
High-Impact Changes
Minor-Impact Changes
Low-Impact Changes
The Easiest way to upgrade
For your convenience, we have created an operations:upgrade console command:
It will do the following:
Changing the old namespace of “actions” to a new one
Moves files to a new location
Updates the configuration file
Rename the stub file (if published)
Please note that the script allows you to automate most of the actions, but may not complete them completely. Therefore, you will need to manually check the result of the upgrade by checking this guide.
Updating Dependencies
You should change the package name in the composer.json file from dragon-code/laravel-actions to dragon-code/laravel-deploy-operations, and also change its version to ^6.0:
Then you need to update the dependencies:
Changed the namespace
The namespace has been changed from DragonCode\LaravelActions to DragonCode\LaravelDeployOperations.
You need to replace it in all actions of your application, as well as when using Events.
Changed the name of the main class
You should replace DragonCode\LaravelActions\Action namespace with DragonCode\LaravelDeployOperations\Operation.
Changed names of console commands
New Name | Old Name |
|---|---|
make:operation | make:action |
operations | actions |
operations:fresh | actions:fresh |
operations:install | actions:install |
operations:refresh | actions:refresh |
operations:reset | actions:reset |
operations:rollback | actions:rollback |
operations:status | actions:status |
operations:stub | actions:stub |
operations:upgrade | actions:upgrade |
Changed event names
New Name | Old Name |
|---|---|
DeployOperationStarted | ActionStarted |
DeployOperationEnded | ActionEnded |
DeployOperationFailed | ActionFailed |
NoPendingDeployOperations | NoPendingActions |
Don't forget to also change the namespace from DragonCode\LaravelActions\Events to DragonCode\LaravelDeployOperations\Events.
Changed property typing for events
The type of the method property for events has been changed.
Before
After
Configuration file name changed
We recommend that you delete the old configuration file config/actions.php and publish a new one. This way you will see the changes made to it.
Changed names of constants
If you use package constant references, you must also rename them.
The old name was in UPPER_CASE, the new one was in PascalCase.
For example:
Changed directory location
File storage directory changed to /operations from /actions.
Database transactions
The following properties have been removed:
$transactions$transactionAttempts
Instead, you can use the hasTransactions and transactionAttempts methods.
The enabledTransactions method has been renamed to hasTransactions.
Removed $async property
The $async property has been removed from the base class. You can use the previously available isAsync method instead.
Stub name changed
If you published a stub file, then you also need to rename it from stubs/action.stub to stubs/deploy-operation.stub and make changes to its structure.
Removed operations:stub command
The php artisan operations:stub console command has been removed. Use another command instead: