I moved my project to HOST but I can still access .env with address mysite.com/.env and display this file with all variables and secure data. my .env file :
In my case when was I host my project in shared hosting my .env file was accessible, my folder structure was like this Root |+ App | App | config | Database | Routes | Storage | .env | ... | index.php | .htaccess |+ css |+ js
My .env file was accessible via this website.com/app/.env Solution Put all your public content to a folder name it public and change the root document path in settings [don't forget to change app.php path in index.php file] |+app |+public
bootrap.php file path should be like this /../app/vendor/autload.php & /../app/bootstrap/app.php