You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,36 @@ database, you will be prompted for confirmation before the commands are executed
109
109
php artisan migrate:actions --force
110
110
```
111
111
112
+
#### Execution every time
113
+
114
+
In some cases, you need to call the code every time you deploy the application. For example, to call reindexing.
115
+
116
+
To do this, override the `$once` variable in the action file:
117
+
118
+
```php
119
+
use Helldar\LaravelActions\Support\Actionable;
120
+
121
+
class Reindex extends Actionable
122
+
{
123
+
protected $once = false;
124
+
125
+
public function up(): void
126
+
{
127
+
// your calling code
128
+
}
129
+
130
+
public function down(): void
131
+
{
132
+
//
133
+
}
134
+
}
135
+
```
136
+
137
+
If the value is `$once = false`, the `up` method will be called every time the `migrate:actions` command called.
138
+
139
+
In this case, information about it will not be written to the `migration_actions` table and, therefore, the `down` method will not be called when the rollback
140
+
command is called.
141
+
112
142
### Rolling Back Actions
113
143
114
144
To roll back the latest action operation, you may use the `rollback` command. This command rolls back the last "batch" of actions, which may include multiple
0 commit comments