Changing database name in Laravel/Homestead

It is most likely an issue with environments. Check that you have a database configuration file in app/config/local/, and check that it has the proper settings.


I am currently dealing with this issue as well. Changed the .env file numerous times as well as the config.php file. Nothing seemed to work. After having done some deep digging into the framework I have found an acceptable temporary workaround to the problem that does not conflict with ANY of Laravel 5.0.2's Exceptions.

NOTE: I'm currently using Ampps 3.4 with php 7.0.2 phpmyadmin 4.4.15.1 on a Windows 8.1 OS.

Inside of the file "ConnectionFactory.php" (located at "laravel\vendor\laravel\framework\src\Illuminate\Database\Connectors"), scroll down to the public function make located at line 41. Within this function you can do the following after this statement $config = $this->parseConfig($config, $name); which should be on line 43:

$config['database'] = 'Insert the name of your database here';

This change will allow Laravel to continue with its normal process having no negative effect anywhere with the framework or your project. That is until this bug is fixed by the makers of Laravel or the community.

Till then happy coding! =)


If anyone finds this looking for the answer for Laravel 5 or later: It's the same as @camroncade says, but in this case it's your .env file in the project root you want to look at.