protected function writeNewEnvironmentFileWith($keys)
    {
        $contents = file_get_contents($this->laravel->environmentFilePath());

        if (! Str::contains($contents, 'VAPID_PUBLIC_KEY')) {
            $contents .= PHP_EOL.'VAPID_PUBLIC_KEY=';
        }

        if (! Str::contains($contents, 'VAPID_PRIVATE_KEY')) {
            $contents .= PHP_EOL.'VAPID_PRIVATE_KEY=';
        }

        $contents = preg_replace(
            [
                $this->keyReplacementPattern('VAPID_PUBLIC_KEY'),
                $this->keyReplacementPattern('VAPID_PRIVATE_KEY'),
            ],
            [
                'VAPID_PUBLIC_KEY='.$keys['publicKey'],
                'VAPID_PRIVATE_KEY='.$keys['privateKey'],
            ],
            $contents
        );

        file_put_contents($this->laravel->environmentFilePath(), $contents);
    }
protected function writeNewEnvironmentFileWith($keys)
    {
        $contents = file_get_contents($this->laravel->environmentFilePath());

        if (! Str::contains($contents, 'VAPID_PUBLIC_KEY')) {
            $contents .= PHP_EOL.'VAPID_PUBLIC_KEY=';
        }

        if (! Str::contains($contents, 'VAPID_PRIVATE_KEY')) {
            $contents .= PHP_EOL.'VAPID_PRIVATE_KEY=';
        }

        $contents = preg_replace(
            [
                $this->keyReplacementPattern('VAPID_PUBLIC_KEY'),
                $this->keyReplacementPattern('VAPID_PRIVATE_KEY'),
            ],
            [
                'VAPID_PUBLIC_KEY='.$keys['publicKey'],
                'VAPID_PRIVATE_KEY='.$keys['privateKey'],
            ],
            $contents
        );

        file_put_contents($this->laravel->environmentFilePath(), $contents);
    }
protected function writeNewEnvironmentFileWith ( $ keys ) { $ contents = file_get_contents ( $ this -> laravel -> environmentFilePath ( ) ) ; if ( ! Str :: contains ( $ contents , 'VAPID_PUBLIC_KEY' ) ) { $ contents .= PHP_EOL . 'VAPID_PUBLIC_KEY=' ; } if ( ! Str :: contains ( $ contents , 'VAPID_PRIVATE_KEY' ) ) { $ contents .= PHP_EOL . 'VAPID_PRIVATE_KEY=' ; } $ contents = preg_replace ( [ $ this -> keyReplacementPattern ( 'VAPID_PUBLIC_KEY' ) , $ this -> keyReplacementPattern ( 'VAPID_PRIVATE_KEY' ) , ] , [ 'VAPID_PUBLIC_KEY=' . $ keys [ 'publicKey' ] , 'VAPID_PRIVATE_KEY=' . $ keys [ 'privateKey' ] , ] , $ contents ) ; file_put_contents ( $ this -> laravel -> environmentFilePath ( ) , $ contents ) ; }
Write a new environment file with the given keys.

@param  array $keys
@return void
Write a new environment file with the given keys .