You might need to change how Laravel is detecting which environment you are using. In the homestead.yaml file add an environment variable for 'local' if there is not one already. Make sure you change the database name in the app/config/local/database.php
variables:
- key: ENV
value: local
Then in the main directory of your app go to /app/bootstrap/start.php
Add the following code in detect environment.
$env = $app->detectEnvironment(function(){
return getenv('ENV') ?: 'development';
});
Note: to use artisan on the command line you will have to add "--env=local" to all of your commands if you use this method.
You can change which database your Laravel app uses. Homestead uses a homestead DB by default so that you can skip a step if you only have one site.
To add a new database navigate the homestead directory using the console and then:
$ vagrant ssh
$ mysql -uhomestead -p
$Enter Password: secret
mysql> create database foo
Then in your local configuration folder in your Laravel app change the database name to "foo" or whatever you want to name your new database.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community