Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@env @endenv tags not processed #150

Open
dingman opened this issue Apr 30, 2020 · 1 comment
Open

@env @endenv tags not processed #150

dingman opened this issue Apr 30, 2020 · 1 comment

Comments

@dingman
Copy link

dingman commented Apr 30, 2020

TIA for such a great package

I'm having an issue with @env and @endenv in my code, where it outputs it literally instead of processing it.

Is this a bug or am I possibly using it incorrectly?

@env('production')
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
        new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
        j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
        'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','{{ config('gtmid') }}');</script>
@endenv
@csoutham
Copy link

Environment variables should always be loading through config files (so they have defaults and can be cached).
You should really be doing @if (config('app.env') === 'production')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants