New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

How to test for dev environment in Add-on?

Erin Dalzell September 13, 2014 by Erin Dalzell

I'd like to do something ONLY if I'm in a dev environment.

Is the only way to do this:

        $env = Environment::get();

        if ($env == "dev") {

        }

Seems ooky to me. I'd rather have an $is_dev variable or something?

Answered by Jason Varga!
>>>>>>> Answered <<<<<<<
3 Replies
1 Follower