private function parseFile()
    {
        $contents = file_get_contents($this->getPath());
        $lines = new Collection(explode("\n", $contents));
        $result = new Collection();

        $lines->filter(function ($value) {
            return $value;
        })->each(function ($value) use ($result) {
            preg_match('/([a-zA-Z_-]+)\=(.+)/', $value, $regexResult);

            array_shift($regexResult);
            $result->push(new Collection($regexResult));
        });

        return $result;
    }
private function parseFile()
    {
        $contents = file_get_contents($this->getPath());
        $lines = new Collection(explode("\n", $contents));
        $result = new Collection();

        $lines->filter(function ($value) {
            return $value;
        })->each(function ($value) use ($result) {
            preg_match('/([a-zA-Z_-]+)\=(.+)/', $value, $regexResult);

            array_shift($regexResult);
            $result->push(new Collection($regexResult));
        });

        return $result;
    }
private function parseFile ( ) { $ contents = file_get_contents ( $ this -> getPath ( ) ) ; $ lines = new Collection ( explode ( "\n" , $ contents ) ) ; $ result = new Collection ( ) ; $ lines -> filter ( function ( $ value ) { return $ value ; } ) -> each ( function ( $ value ) use ( $ result ) { preg_match ( '/([a-zA-Z_-]+)\=(.+)/' , $ value , $ regexResult ) ; array_shift ( $ regexResult ) ; $ result -> push ( new Collection ( $ regexResult ) ) ; } ) ; return $ result ; }
Parse the .env file contents for easier handling.

@return \Illuminate\Support\Collection
Parse the . env file contents for easier handling .