Set an URL in laravel from environment variable -
i have form in html, in action, set page want send data:
<form action="wherever.com" method="post" target="_blank" style="display: inline;">
the problem laravel, in .env file set this:
wherever_form="http://wherever.com"
ok, want set env variable in action, have tried this:
action="env('wherever_form')"
also this:
action="env(wherever_form)"
and this:
action="{{env('wherever_form')}}"
i know can env variable, don´t find how it, in laravel documentation found this:
$env = env('app_env'); // return default value if variable doesn't exist... $env = env('app_env', 'production');
this not enough me.
someone can me?
i think .env file setup ok:
wherever_form="http://wherever.com"
and also:
<form action="{{env('wherever_form')}}" method="post" target="_blank" style="display: inline;">
however, please make sure reboot application after changing .env file. can by:
php artisan serve
Comments
Post a Comment