What to include in gitignore for a Laravel and PHPStorm project? What to include in gitignore for a Laravel and PHPStorm project? laravel laravel

What to include in gitignore for a Laravel and PHPStorm project?


Unless PHPStorm is an official part of the project (e.g. it's mandated by a company, or agreed to by all team members) I would urge you to put its ignore settings into .git/info/exclude instead of .gitignore. The former is local to your copy, the latter should be committed and shared.

gitignore.io suggests this for Laravel:

# Created by https://www.gitignore.io/api/laravel### Laravel ###vendor/node_modules/npm-debug.log# Laravel 4 specificbootstrap/compiled.phpapp/storage/# Laravel 5 & Lumen specificpublic/storagepublic/hotstorage/*.key.env.*.php.env.php.envHomestead.yamlHomestead.json# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer.rocketeer/

and this for PHPStorm:

# Created by https://www.gitignore.io/api/phpstorm### PhpStorm #### Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839# User-specific stuff:.idea/**/workspace.xml.idea/**/tasks.xml# Sensitive or high-churn files:.idea/**/dataSources/.idea/**/dataSources.ids.idea/**/dataSources.xml.idea/**/dataSources.local.xml.idea/**/sqlDataSources.xml.idea/**/dynamic.xml.idea/**/uiDesigner.xml# Gradle:.idea/**/gradle.xml.idea/**/libraries# Mongo Explorer plugin:.idea/**/mongoSettings.xml## File-based project format:*.iws## Plugin-specific files:# IntelliJ/out/# mpeltonen/sbt-idea plugin.idea_modules/# JIRA pluginatlassian-ide-plugin.xml# Crashlytics plugin (for Android Studio and IntelliJ)com_crashlytics_export_strings.xmlcrashlytics.propertiescrashlytics-build.propertiesfabric.properties### PhpStorm Patch #### Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721# *.iml# modules.xml# .idea/misc.xml# *.ipr

As an aside, gitignore.io can be accessed via the command-line, so you can do things like

gi laravel,phpstorm >> .gitignore

It's a pretty handy little tool.


I use this smart .gitignore file ;) , Hope it may help someone:

/node_modules# ignore log files and databases*.log*.sql*.sqlite# ignore compiled files*.com*.class*.dll*.exe*.o*.so# ignore packaged files*.7z*.dmg*.gz*.iso*.jar*.rar*.tar*.zip# ignore OS generated filesehthumbs.dbThumbs.db.DS_Store.DS_Store?._*.Spotlight-V100.Trashes# ignore Editor files*.sublime-project*.sublime-workspace*.komodoproject_ide_helper.php/.idea/.vscode# Eclipse project files.buildpath.project.settings/# Ignore cache.cache/# Ignore user created files :)*.bak*.orig# Ignore system files.bash_historyLICENSE_AFL.txtLICENSE.htmlLICENSE.txtLICENSE_EE*RELEASE_NOTES.txt.ssh/error_log.htpasswds/.htaccessphp.ini.sample.modgit/_vti_bin/_vti_cnf/_vti_inf.html_vti_log/_vti_pvt/_vti_txt/tmp/php.ini_old/.htpasswds/.htpasswd.viminfo.profile.bashrc.bash_logout.modman/pkginfonohup.outHomestead.yamlHomestead.json/.vagrant.phpunit.result.cache#Laravel Specific files/vendor.env/public/.htaccess/storagestorage/*.key


Laravel automatically create it after installation:

/node_modules/public/hot/public/storage/storage/*.key/vendor.env.env.backup.phpunit.result.cacheHomestead.jsonHomestead.yamlnpm-debug.logyarn-error.log