Get environment value in controller January 8, 2023 by Tarik Try it with: <?php $hostname = env("IMAP_HOSTNAME_TEST", "somedefaultvalue"); ?>