/** * Define environment setup. * * @param \Illuminate\Foundation\Application $app * @return void */ protected function getEnvironmentSetUp($app) { $env = __DIR__ . '/../.env'; if (is_readable($env) && is_file($env)) { $app->loadEnvironmentFrom('../../../../.env'); $app->make('Illuminate\\Foundation\\Bootstrap\\DetectEnvironment')->bootstrap($app); } $app['config']->set('services.viva', ['api_key' => env('VIVA_API_KEY', str_random()), 'merchant_id' => env('VIVA_MERCHANT_ID', str_random()), 'public_key' => env('VIVA_PUBLIC_KEY', str_random()), 'environment' => env('VIVA_ENVIRONMENT', 'demo')]); }
public function createApplication() { $app = new Application(__DIR__ . '/../stub'); $app->instance('path', ''); $app->instance('path.base', ''); $app->instance('path.storage', ''); $app->instance('config', new Config()); $app->loadEnvironmentFrom(__DIR__ . '/../examples/' . '.env'); (new DetectEnvironment())->bootstrap($app); return $app; }
/** * Set the environment file to be loaded during bootstrapping. * * @param string $file * @return $this * @static */ public static function loadEnvironmentFrom($file) { return \Illuminate\Foundation\Application::loadEnvironmentFrom($file); }