I'm not sure why this isn't working? I want to be able to access the constants set in my .env.php file but NetBeans is showing an error stating that the getenv function isn't recognized.
Here is my code
<?php
class Blah extends Eloquent {
...
protected $connection = getenv('DB_NAME');
}
Set the class values from the constructor.
class Blah extends Eloquent
{
protected $connection = null;
function __construct() {
$this->connection = getenv('DB_NAME');
}
}
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