Php – How to handle multiple developer configuration in a project

frameworksgitlaravelPHP

I've been thinking lately about how I handle config changes between multiple developers on a project.

Specifically here about a Laravel project in PHP, but I guess this applies largely to all frameworks/languages.

In general would you say it's a best practice to not commit your configuration? If so what's your practice for doing this with version control such as git?

Or do you set up each configuration as a different environment config? E.g. In Laravel there are environment configs, so each developer has a directory of just their own different settings, and this is what I'm currently using. Then in the code you can set how Laravel will detect which environment it's on. This works, I'm just wondering what other developers working on projects with other developers do.

Best Answer

You're doing it right

The benefit is that you are actually testing the mechanisms which will be used when deploying to other environments; test, staging, production, etc. Each developer will be automatically verifying that environment specific configuration is working.

I have tried the template approach and not checking in each developers configuration. This works but you will find from time to time something breaks for everyone.

Related Topic