protected function setHashInEnvironmentFile($hash)
    {
        $envPath = $this->laravel->environmentFilePath();
        $envContent = $this->filesystem->get($envPath);

        $regex = '/UNDER_CONSTRUCTION_HASH=\S+/';

        if (preg_match($regex, $envContent)) {
            $hash = str_replace(['\\', '$'], ['', '\$'], $hash);
            $envContent = preg_replace($regex, $this->newLine($hash), $envContent);
        } else {
            $envContent .= "\n".$this->newLine($hash)."\n";
        }

        $this->filesystem->put($envPath, $envContent);
    }
protected function setHashInEnvironmentFile($hash)
    {
        $envPath = $this->laravel->environmentFilePath();
        $envContent = $this->filesystem->get($envPath);

        $regex = '/UNDER_CONSTRUCTION_HASH=\S+/';

        if (preg_match($regex, $envContent)) {
            $hash = str_replace(['\\', '$'], ['', '\$'], $hash);
            $envContent = preg_replace($regex, $this->newLine($hash), $envContent);
        } else {
            $envContent .= "\n".$this->newLine($hash)."\n";
        }

        $this->filesystem->put($envPath, $envContent);
    }
protected function setHashInEnvironmentFile ( $ hash ) { $ envPath = $ this -> laravel -> environmentFilePath ( ) ; $ envContent = $ this -> filesystem -> get ( $ envPath ) ; $ regex = '/UNDER_CONSTRUCTION_HASH=\S+/' ; if ( preg_match ( $ regex , $ envContent ) ) { $ hash = str_replace ( [ '\\' , '$' ] , [ '' , '\$' ] , $ hash ) ; $ envContent = preg_replace ( $ regex , $ this -> newLine ( $ hash ) , $ envContent ) ; } else { $ envContent .= "\n" . $ this -> newLine ( $ hash ) . "\n" ; } $ this -> filesystem -> put ( $ envPath , $ envContent ) ; }
Set the hash in .env file.

@param $hash
@throws \Illuminate\Contracts\Filesystem\FileNotFoundException
Set the hash in . env file .