Support the ongoing development of Laravel.io →
posted 9 years ago
Database

Hello. When I specify environment on migrate command "php aritsan migrate --env=testing" it is not applied. All migrations run on my 'local' database. I assume Laravel should take settings from '.env.testing' file. Am I correct or this is expected behaviour?

Last updated 3 years ago.
0

dont you have a phpunit.xml file in the root folder? specify it there..

    <env name="APP_ENV" value="testing"/>
0

I have this value in php unit. By now I found another approach - to create another db connection setting in 'database.php'. (As stated in this instruction https://github.com/janhenkgerritsen/codeception-laravel5-sample) E.g. 'mysql_testing' with hardcoded values of db settings. And then use 'php artisan migrate --database=mysql_testing'. The question for me is whether this is a Laravel bug that should be reported.

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Vishnja vishnja Joined 20 Sep 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.