Level 88
You can check on environment or check if you currently run the tests
public function up()
{
if (app()->environment() === 'testing') {
// Do your thing
}
// An alternative would be this
if (app()->runningUnitTests()) {
// Do your thing
}
}
4 likes