Im new to this, and have been trying for a few hours to get this to work. I have a project with this structure:
/API
-.env
/Processor
-index.php
The contents of my .env file is this:
API_KEY=xxxx
and in my index.php file
require __DIR__ . '/../vendor/autoload.php';
$dotenv = new Dotenv\Dotenv(__DIR__.'/../');
$dotenv->load();
$client = Client::withApiKey($_ENV['API_KEY']);
It works if I replace $_ENV['API_Key'] with the actual key, so I believe the rest of the setup is correct. I feel like Im missing the correct path to the .env file - how do I check and or fix?