One of the weirdest things on D8 is that it does not support .env files, and I want to try to fix this.
I am reading the documentation, and one of the first things I have seen is that there is no hook_init in D8, instead they recommend doing this: link
What I want is for the values indicated in an .env file to be accessible in Drupal, but I do not see how to do it.
I understand that the dotenv class that I installed in Vendor must be deified as a service
services:
dotenv.default:
class: \dontevn\dotenv
arguments: []
But I do not know how to define the moment in which to load the class, to load the .env file
Thanks
Oskar