| Conditions | 2 | 
| Paths | 2 | 
| Total Lines | 20 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php | ||
| 20 | public function runDatabaseMigrations() | ||
| 21 |     { | ||
| 22 | // if disabled we just run parent method and that's it | ||
| 23 |         if (! config('quick_migrations.enabled')) { | ||
| 24 | $this->useDefaultWay(); | ||
| 25 | |||
| 26 | return; | ||
| 27 | } | ||
| 28 | |||
| 29 | // otherwise we just run single migration that loads database dump | ||
| 30 |         $this->artisan('migrate:fresh', [ | ||
|  | |||
| 31 | '--path' => realpath(__DIR__ . '/../migrations'), | ||
| 32 | '--realpath' => 1, | ||
| 33 | ]); | ||
| 34 | |||
| 35 | $this->app[Kernel::class]->setArtisan(null); | ||
| 36 | |||
| 37 | // here we don't care about rollback (to make it faster) | ||
| 38 |         $this->beforeApplicationDestroyed(function () { | ||
| 39 | RefreshDatabaseState::$migrated = false; | ||
| 40 | }); | ||
| 52 |