Answers for "laravel .env file download"

PHP
2

get env app url laravel

env('APP_URL')
Posted by: Guest on November-28-2020
1

laravel update env file programmatically

public static function envUpdate($key, $value)
    {
        $path = base_path('.env');

        if (file_exists($path)) {

            file_put_contents($path, str_replace(
                $key . '=' . env($key), $key . '=' . $value, file_get_contents($path)
            ));
        }
    }

And reload the page programatically again using js only once
<script>
  	window.location.reload();
</script>
Posted by: Guest on June-29-2020
0

Load differenet .env file in laravel

public function bootstrap() 
{
    app()->loadEnvironmentFrom('.env.test');
    parent::bootstrap(); 
}
Posted by: Guest on October-21-2021

Browse Popular Code Answers by Language