Can Livewire update env file?

What seems to be the problem: Issue when updating .env file

Steps to Reproduce: Just update anything on the .env file and all subsequent Livewire request will fail

Are you using the latest version of Livewire: Yes

Do you have any screenshots or code examples: No

What is your use case for this? Generally .env files contain environment configuration options which won’t change. If you’re looking to offer configurable options I’d consider writing to a data store. Use your .env as a default or fallback if an option cannot be found.

Well, I’m planning to create a Script Installer with Livewire.

Now, to do that, I have to accept Database Credentials and once I accept that, all subsequent requests are getting failed because of env file change.

The best work around, I could find, is to emit a browser event after updating the .env file to refresh the page and then run the next requests.

Is there a better solution for this?