I am creating an app using Symfony 4 and Docker. In my .env file, I have the following line:
DEVICE_CREATION_SECRET=123456
... and in my services.yaml file, I have the following definition:
VMS\Application\DigitalRetail\Handler\DeviceForwardHandler:
arguments:
- env(DEVICE_CREATION_SECRET)
... which I expect to hand off my secret (123456) to my class, since I have this in that class:
public function __construct(string $deviceCreationSecret)
{
$this->deviceCreationSecret = $deviceCreationSecret;
}
But when I run my app and dump out the value, I get env(DEVICE_CREATION_SECRET)
rather then my secret (123456). What do I need to get access to that secret?
I think this way should work:
VMS\Application\DigitalRetail\Handler\DeviceForwardHandler:
arguments:
- '%env(DEVICE_CREATION_SECRET)%'
https://symfony.com/doc/current/configuration/external_parameters.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With