Laravel .env: Difference between revisions

From AWVVO
Jump to navigationJump to search
Created page with "== Get .env variable == <syntaxhighlight lang="php" copy> // .env APP_MY_VAR="xyz" // get value $value = env('APP_MY_VAR', 'default'); </syntaxhighlight>"
 
 
Line 7: Line 7:
$value = env('APP_MY_VAR', 'default');
$value = env('APP_MY_VAR', 'default');
</syntaxhighlight>
</syntaxhighlight>
[[Category:Laravel]]

Latest revision as of 13:58, 19 January 2025

Get .env variable

// .env
APP_MY_VAR="xyz"

// get value
$value = env('APP_MY_VAR', 'default');