@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function __construct() |
30 | 30 | { |
31 | 31 | if (!isset($this->collection) || $this->collection === '') { |
32 | - throw new InternalErrorException('Collection name must be specified on migration: ' . get_called_class()); |
|
32 | + throw new InternalErrorException('Collection name must be specified on migration: '.get_called_class()); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | final public function up() |
42 | 42 | { |
43 | 43 | if (!Schema::connection($this->connection)->hasTable($this->collection)) { |
44 | - Schema::connection($this->connection)->create($this->collection, function (Blueprint $collection) { |
|
44 | + Schema::connection($this->connection)->create($this->collection, function(Blueprint $collection) { |
|
45 | 45 | if (method_exists($this, 'migrate')) |
46 | 46 | $this->migrate($collection); |
47 | 47 | }); |
@@ -42,8 +42,9 @@ discard block |
||
42 | 42 | { |
43 | 43 | if (!Schema::connection($this->connection)->hasTable($this->collection)) { |
44 | 44 | Schema::connection($this->connection)->create($this->collection, function (Blueprint $collection) { |
45 | - if (method_exists($this, 'migrate')) |
|
46 | - $this->migrate($collection); |
|
45 | + if (method_exists($this, 'migrate')) { |
|
46 | + $this->migrate($collection); |
|
47 | + } |
|
47 | 48 | }); |
48 | 49 | } |
49 | 50 | } |
@@ -56,8 +57,9 @@ discard block |
||
56 | 57 | final public function down() |
57 | 58 | { |
58 | 59 | if (Schema::connection($this->connection)->hasTable($this->collection)) { |
59 | - if (method_exists($this, 'destroy')) |
|
60 | - $this->destroy(); |
|
60 | + if (method_exists($this, 'destroy')) { |
|
61 | + $this->destroy(); |
|
62 | + } |
|
61 | 63 | Schema::connection($this->connection)->drop($this->collection); |
62 | 64 | } |
63 | 65 | } |
@@ -24,15 +24,15 @@ |
||
24 | 24 | /* If refresh fails. It usually means the database was only partially migrated or seeded. |
25 | 25 | ** Start fresh if that's the case |
26 | 26 | **/ |
27 | - try{ |
|
27 | + try { |
|
28 | 28 | $this->artisan('migrate:refresh'); |
29 | - } catch (\Exception $e){ |
|
29 | + } catch (\Exception $e) { |
|
30 | 30 | $this->artisan('cache:model:clear'); |
31 | 31 | $this->artisan('migrate:fresh'); |
32 | 32 | $this->artisan('migrate:refresh'); |
33 | 33 | } |
34 | 34 | $this->artisan('db:seed'); |
35 | - $this->beforeApplicationDestroyed(function () { |
|
35 | + $this->beforeApplicationDestroyed(function() { |
|
36 | 36 | RefreshDatabaseState::$migrated = false; |
37 | 37 | }); |
38 | 38 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | $this->resolver->setDefaultConnection($this->getDatabase()); |
37 | 37 | |
38 | - Model::unguarded(function () { |
|
38 | + Model::unguarded(function() { |
|
39 | 39 | foreach ($this->getSeeders() as $seeder) { |
40 | 40 | $this->laravel->make($seeder)->__invoke(); |
41 | 41 | } |
@@ -48,6 +48,6 @@ discard block |
||
48 | 48 | { |
49 | 49 | $this->service = $this->laravel->make(BootstrapRegistrarService::class); |
50 | 50 | |
51 | - return $this->service->getSeeders() ?? []; |
|
51 | + return $this->service->getSeeders() ?? [ ]; |
|
52 | 52 | } |
53 | 53 | } |