skip to Main Content

recently I used the GitHub to uppload my project on it. but when another my friend want to sync with my project he can’t find the .env file

how should I do now?

2

Answers


  1. Check your .gitignore file.
    I think this is included in .gitignore file so that it is not included and not uploaded to github.
    Since, .env file includes your project specific secrets and configurations, it shouldnot be exposed to others.
    However, If you want to upload it anyway, remove its entry on .gitignore file. This may resolve your issue.

    Login or Signup to reply.
  2. As Shiva answered, the file is ignored by git because it’s mentioned in your .gitignore file. You could remove it from the file so you can upload it as long as you are aware of the security implications. A better option would be to encrypt it. Since Laravel v9.23 you can encrypt your .env file with Artisan using env:encrypt and decrypt with env:decrypt

    Unencrypted environment files should never be stored in source control. However, Laravel allows you to encrypt your environment files so that they may safely be added to source control with the rest of your application.

    See: https://laravel.com/docs/10.x/configuration#encryption

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search