Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

LaraBABA's avatar

Gitignore advise for Laravel please

Hello,

I am struggling with the configuration of my Git Ignore, I am not sure if it is correct, at the moment I have this(I am using phpstorm)

vendor/
node_modules/
npm-debug.log
yarn-error.log

# Laravel 4 specific
bootstrap/compiled.php
# Laravel 5 & Lumen specific
public/storage
public/hot
public/assets
public/plugins
storage/cache/data
# Laravel 5 & Lumen specific with changed public path
public_html/storage
public_html/hot

storage/*.key
.env
Homestead.yaml
Homestead.json
/.vagrant
.phpunit.result.cache
.DS_Store
.idea/
**.idea
*.xml
.phpstorm.meta.php
_ide_helper.php

Each time I run 'npm run dev' or 'npm run production', shall I git these outputs? Same for the storage/cache/ , what shall I do please?

Thank you.

0 likes
1 reply
gitwithravish's avatar

I believe the .gitignore files ships with laravel project template by deafaut. Why do you need to configure it like this by yourself?

Please or to participate in this conversation.