laracraft-tech / laravel-useful-additions Goto Github PK
View Code? Open in Web Editor NEWA collection of useful Laravel additions!
Home Page: https://laracraft.tech/post/laravel-useful-additions
License: MIT License
A collection of useful Laravel additions!
Home Page: https://laracraft.tech/post/laravel-useful-additions
License: MIT License
I couldn't figure out why seeding was not working, but in the runMigrationsIfNecessary method of the Trait, you are first seeding (upon checking the configuration parameter, that's correct) but then you're doing a migrate fresh completely emptying the seeding :)
In the DatabaseMigrations trait:
/**
* Define hooks to migrate the database before and after each test.
*
* @return void
*/
public function runDatabaseMigrations()
{
$this->beforeRefreshingDatabase();
$this->refreshTestDatabase();
$this->afterRefreshingDatabase();
$this->beforeApplicationDestroyed(function () {
$this->artisan('migrate:rollback');
RefreshDatabaseState::$migrated = false;
});
}
The "migrate:rollback" call is basically reverting all of the fresh migration, so the second time the tests run, the checksum matches while the database is completely empty.
Not sure if this is due to a code update, or if there's a best practices way of avoiding this.
For now, I've overridden the runDatabaseMigrations method to remove the rollback command.
When refresh_db_fast.seed is enabled, the seeders folder should not be excluded for checksum calculation. So when there is a change in seeders, the db should be seeded on the next test run.
See Patch File:
seeder.patch
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.