I\'m setting up a new app with laravel (Laravel 4), and having some issues setting up the database via migrations.
I made a migration file with:
artisan
I figured out a solution to run migrate
for different databases. Basically, the command artisan migrate --env=local
doesn't work. But we can define a new connection string in config\database.php
. For example:
[
'driver' => 'mysql',
'host' => env('DB_TESTING_HOST'),
'database' => env('DB_TESTING_DATABASE'),
'username' => env('DB_TESTING_USERNAME'),
'password' => env('DB_TESTING_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => 'prefix_',
],
And specify the --database
when we run artisan migrate
like this:
php artisan migrate --database=mysql_testing
Hope this helps :)