Q:

Make laravel mix proxy address the same for all projects

I have some laravel mix settings for my project:
  mix.js('resources/js/app.js', 'public/js')
   .sass('resources/scss/main.scss', 'public/css')
   .sass('resources/scss/test.scss', 'public/css')
   .options({
      processCssUrls: false
   })

  .copyDirectory('resources/images', 'public/images')
  .copyDirectory('resources/fonts', 'public/fonts')
  .browserSync({
    proxy: 'quiz.local',
    files: ["public/css/main.css", "public/js/*.js"],
    watchOptions: {
        ignored: /node_modules/
    }
})

What I don't like about these settings is that the proxy address is not good - if another developer has a different local address, it's not gonna work for them. Is there any way to make it useful for all the developers apart from asking them to change the local server name to quiz.local?

A:

You can inject environment variables into mix. In theory, each .env file should be unique / not uploaded to version control anyway.

You may inject environment variables into Mix by prefixing a key in
  your .env file with MIX_:
MIX_SENTRY_DSN_PUBLIC=http://example.com 
After the variable has been
  defined in your .env file, you may access via the process.env object.
  If the value changes while you are running a watch task, you will need
  to restart the task:

Following this, your mix file would end up looking something like this;
.browserSync({
    proxy: process.env.MIX_SENTRY_DSN_PUBLIC,
    files: ["public/css/main.css", "public/js/*.js"],
    watchOptions: {
        ignored: /node_modules/
    }

