How can I have .env data such as APP_NAME in my components?
Let say I want to show to users Welcome to {{APP_NAME}}
UPDATE
Base on this document I've made changes in my env file and like:
MIX_APP_NAME=Laravel
and added this to my component script:
data() {
return {
app_name: process.env.MIX_APP_NAME,
}
},
Now I can have my app name in my component but the issue is I want to use it in bootstrap tooltip and there gives me this error:
- title=".... by {{app_name}}": Interpolation inside attributes has been removed. Use v-bind or the colon shorthand instead. For example, instead of <div id="{{ val }}">, use <div :id="val">.
My code:
<span data-toggle="tooltip" data-placement="top" title="... {{app_name}}"></span>
Any idea?
${app_name}in my view:title="`text ${app_name}`"