Skip to content

Commit 694a703

Browse files
author
Andrey Helldar
committed
Removed forced definition of down method
1 parent d2785ba commit 694a703

File tree

5 files changed

+12
-27
lines changed

5 files changed

+12
-27
lines changed

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Or manually update `require` block of `composer.json` and run `composer update`.
4545
```json
4646
{
4747
"require": {
48-
"andrey-helldar/laravel-actions": "^1.3"
48+
"andrey-helldar/laravel-actions": "^1.4"
4949
}
5050
}
5151
```
@@ -126,12 +126,7 @@ class Reindex extends Actionable
126126

127127
public function up(): void
128128
{
129-
// your calling code
130-
}
131-
132-
public function down(): void
133-
{
134-
//
129+
// your code
135130
}
136131
}
137132
```
@@ -166,11 +161,6 @@ class AddSomeData extends Actionable
166161

167162
$post->tags()->sync($ids);
168163
}
169-
170-
public function down(): void
171-
{
172-
//
173-
}
174164
}
175165
```
176166

src/Support/Actionable.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ abstract class Actionable extends Migration implements Contract
2626
*/
2727
protected $transactions = false;
2828

29+
/**
30+
* Reverse the actions.
31+
*
32+
* @return void
33+
*/
34+
public function down(): void
35+
{
36+
//
37+
}
38+
2939
/**
3040
* Determines the type of launch of the action.
3141
*

tests/fixtures/actions/2021_01_02_020947_every_time.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ public function up(): void
1515
]);
1616
}
1717

18-
public function down(): void
19-
{
20-
// nothing
21-
}
22-
2318
protected function table()
2419
{
2520
return DB::table('every_time');

tests/fixtures/stubs/2021_02_15_124237_test_success_transactions.stub

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ final class TestSuccessTransactions extends Actionable
1717
]);
1818
}
1919

20-
public function down(): void
21-
{
22-
// nothing
23-
}
24-
2520
protected function table()
2621
{
2722
return DB::table('transactions');

tests/fixtures/stubs/2021_02_15_124852_test_failed_transactions.stub

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ final class TestFailedTransactions extends Actionable
1919
throw new Exception('Random message');
2020
}
2121

22-
public function down(): void
23-
{
24-
// nothing
25-
}
26-
2722
protected function table()
2823
{
2924
return DB::table('transactions');

0 commit comments

Comments
 (0)