Changing database name in Laravel/Homestead

后端 未结 3 1678
礼貌的吻别
礼貌的吻别 2021-02-19 14:45

I started learning Laravel just an hour ago and following tutorials.

My settings for database are as follow (File: app/config/database.php):

\'default\'          


        
3条回答
  •  [愿得一人]
    2021-02-19 15:15

    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! =)

提交回复
热议问题