5 months ago

How to use env in Laravel package?

Posted 5 months ago by danielcoker

I'm contributing to a Laravel package, and I need to use the env() function to get the APP_NAME. But when I run the test, I get the error "call to undefined function env()". I want to ask:

  1. Is there another way to get the environment variable APP_NAME in Laravel packages.
  2. How can I set/get this value when writing the test.

Please sign in or create an account to participate in this conversation.