Multi-Environment Configs in CraftCMS 3
For anyone interested, I had set web/index.php to production.

The reason why both staging and production were working was due to me using the same username and password for the database.

Once I had changed this to dev, it now works so I no longer need the .env file.