Laravel migration actions is like version control for your migration process, allowing your team to modify and share the application’s actionable schema. If you have ever had to tell a teammate to perform any action on a production server manually, you’ve come across an issue that actions solve.
Actions are stored within a
database/actions folder and operate similarly to the way migrations work. This package also includes an Artisan command to create new actions. Here’s what an example action might look like:
6class ExampleAction extends Actionable
8 protected $transactions = true;
11 * Run the actions.
13 * @return void
15 public function up(): void
18 'name' => 'Example User',
19 'email' => '[email protected]',
20 'password' => bcrypt('password')
25 * Reverse the actions.
27 * @return void
29 public function down(): void
Some of the packages main features include:
- Ability to run actions every time you call
- Execution of actions only in specific environments
- Exclude actions from specific environments
- Easy database transactions in actions with configurable attempts before failing
- Rolling back actions
- Display the status of actions in the current environment
You can learn more about this package, get full installation instructions, and view the source code on GitHub.