Changing database name in Laravel/Homestead

后端 未结 3 1699
礼貌的吻别
礼貌的吻别 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 14:58

    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.

    0 讨论(0)
  • 2021-02-19 15:09

    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.

    0 讨论(0)
  • 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! =)

    0 讨论(0)
提交回复
热议问题