Skip to content

Commit

Permalink
update env file for sail
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Dec 8, 2020
1 parent 82213fb commit a895748
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,30 @@ LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
# DB_HOST=127.0.0.1
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
QUEUE_CONNECTION=database
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
# MEMCACHED_HOST=127.0.0.1
MEMCACHED_HOST=memcached

# REDIS_HOST=127.0.0.1
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
Expand Down

16 comments on commit a895748

@miken32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DB_HOST=mysql is causing all kinds of problems; I'm seeing multiple questions a day on Stack Overflow about it. I'd file an issue but seems one can't do that here. What is the rationale for changing it from localhost?

@michaeldyrynda
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miken32
Copy link

@miken32 miken32 commented on a895748 Dec 11, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michaeldyrynda
Copy link
Contributor

@michaeldyrynda michaeldyrynda commented on a895748 Dec 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was updated in symmetry with the getting started documentation for Laravel.

The .env file is - and always has - been owned by you from the moment it has been cloned down, so you’re naturally free to make changes to suit your environment.

It’s different than it has been, but it’s not broken. The Laravel application skeleton spent follow semantic versioning.

@crynobone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can execute the command during the intallation:

php artisan tinker --execute="file_put_contents('.env', str_replace(['DB_HOST=mysql'], ['DB_HOST=127.0.0.1'], file_get_contents('.env')));"

@miken32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's all well and good to say "you can change it to whatever you want" but you're not working in a vacuum here. You're invalidating years of instructions and tutorials, and it is causing problems for your users. All I'm suggesting is a note in the documentation saying that you'll need to change the .env file database config if you're installing it with Composer.

@NationwidePharma
Copy link

@NationwidePharma NationwidePharma commented on a895748 Dec 12, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@realodix
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change forces people to use Laravel Sail.

@driesvints
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@realodix these changes don't forces anything. You own this file so free to adjust this in the way you need for your project.

@driesvints
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reverted the defaults and Sail will now update these through laravel.build

@marky291
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reverted the defaults and Sail will now update these through laravel.build

Perfect solution :)

@martindilling
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, but this doesn’t apply to most users. Some mention should be made of the fact that it’s broken out of the box in the documentation section about installing using Composer.

On Dec 11, 2020, at 4:27 PM, Michael Dyrynda @.***> wrote:  Laravel is configured for Sail out of the box. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Who is "most users" and how do they use Laravel, if updating your .env file isn't a common part of starting a project?

@miken32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@driesvints thank you for reconsidering. @martindilling spend some time on Stack Overflow in the PHP tag and you can find out for yourself...

@otilor
Copy link

@otilor otilor commented on a895748 Dec 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to fix this when I noticed it was giving developers issue. @taylorotwell closed it without a definite reason.
#5484

@paras-malhotra
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabrielfemi if you submit PRs with empty descriptions, always expect them to be closed with an "empty" reason.

@Francismori7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reverted the defaults and Sail will now update these through laravel.build

I made a new Sail project yesterday, and the build did not set it to mysql, is it expected?

Please sign in to comment.