<?phpnamespaceIlluminate\Foundation\Testing;useIlluminate\Contracts\Console\Kernel;traitDatabaseMigrations{/** * Define hooks to migrate the database before and after each test. * * @return void */publicfunctionrunDatabaseMigrations(){$this->artisan('migrate:fresh');$this->app[Kernel::class]->setArtisan(null);$this->beforeApplicationDestroyed(function(){$this->artisan('migrate:rollback');RefreshDatabaseState::$migrated=false;});}}