You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While developing on local I want to use the public google maps api so I don't use up my requests, however when on production I need the url which contains a key to authenticate.
How can I conditionally load one or the other based on the environment. I tried to debug and saw there was an $env variable however it's always 'environment' which I assume is based on my laravel rules. However when I compile for production with php artisan basset:build --production I would expect that variable to be 'production' but it's not. I've also noticed there is $argv attributes that I can read, my hack below uses that where I consider it production build if there are 3 arguments 'php artisan' 'basset:build' '--production'
Is this the right way of doing this?
I noticed there was whenProductionBuild() but that's only for a filter correct?
No you should probably use Laravel's environment. Then can be configured in bootstrap/start.php either with machine names or URLs.
And then in your collection you use if (App::environment() == 'production').
The problem when I run the compile for production command line from my local environment it will think its local , our workflow is we compile locally then push rsync to the server.
While developing on local I want to use the public google maps api so I don't use up my requests, however when on production I need the url which contains a key to authenticate.
How can I conditionally load one or the other based on the environment. I tried to debug and saw there was an $env variable however it's always 'environment' which I assume is based on my laravel rules. However when I compile for production with
php artisan basset:build --production
I would expect that variable to be 'production' but it's not. I've also noticed there is $argv attributes that I can read, my hack below uses that where I consider it production build if there are 3 arguments 'php artisan' 'basset:build' '--production'Is this the right way of doing this?
I noticed there was whenProductionBuild() but that's only for a filter correct?
The text was updated successfully, but these errors were encountered: