You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
494 B

<?php
use Illuminate\Contracts\Console\Kernel;
trait DatabaseMigrateSeeds
{
/**
* Define hooks to migrate the database before and after each test.
*
* @return void
*/
public function runDatabaseMigrateSeeds()
{
$this->artisan('migrate');
$this->artisan('db:seed');
$this->app[Kernel::class]->setArtisan(null);
$this->beforeApplicationDestroyed(function () {
$this->artisan('migrate:rollback');
});
}
}