Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Official laravel recommendation of .gitignore confuse me with unused folder

Following is the link for the official Laravel recommendation of .gitignore

https://github.com/laravel/laravel/blob/master/.gitignore

This contains :

/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
.phpunit.result.cache

I've the following confusion :

  1. "/public/hot" when this will be used. did anybody has even seen the "hot" folder used inside the 'public' folder so far?

  2. "/public/storage" when this will be used. did anybody have seen the 'storage' folder used inside 'public' so far?

  3. As "/public/hot" & "/public/storage" are not an obvious part of laravel framework, why is this recommended to add in gitignore?

  4. Why other public subfolders like "public/css/, public/js/, public/fonts/*" are not added above in the list as it would be generated based on "resource/" content.

  5. "/storage/*.key" when this "key" extension file will be created?

  6. Why other storage subfolder like "storage/framework/cache/, storage/framework/sessions/, storage/framework/views/, storage/logs/" are not added in above list ?

  7. What is the best .gitignore list for Laravel 5.4 onwards?

I'd appreciate your thought. Thanks.

like image 919
Amitesh Bharti Avatar asked Aug 23 '18 14:08

Amitesh Bharti


1 Answers

  1. public/hot is a temporary file used by webpack dev server.
  2. public/storage is a symlink to storage/app/public. See filesystem documentation for more info.
    • created by php artisan storage:link
  3. public/hot is only used during development and is created every time npm run hot is ran. public/storage is just a symlink and needs to be created on production and development environments alike.
  4. The web server serves your assets from these directories.
  5. These are secret encryption keys for services like OAuth.
    • Passport's php artisan passport:keys is one example of where they come from. See deploying passport for more info.
  6. The framework needs these for internal usage.
  7. I would say the .gitignore in the official repository is probably a pretty good starting point.
like image 134
Brian Lee Avatar answered Oct 01 '22 19:10

Brian Lee