Sven\FlexEnv\Env::all PHP Méthode

all() public méthode

Gets all the key/value pairs from the .env file.
public all ( ) : array
Résultat array
    public function all()
    {
        $env = $this->parseFile();
        $result = [];
        $env->each(function (Collection $value) use(&$result) {
            return $result[$value->first()] = $value->get(1);
        });
        return $result;
    }

Usage Example

Exemple #1
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function handle()
 {
     $env = new Env(base_path('.env'));
     $data = [];
     foreach ($env->all() as $key => $value) {
         $data[] = [$key, $value];
     }
     return $this->table(['Key', 'Value'], $data);
 }