Merge branch 'master' into 'production'

add config file portal to fix env error maybe

See merge request Romulus21/portal!14
This commit is contained in:
Romain Delanoë
2020-04-04 09:20:03 +00:00
2 changed files with 6 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ class MeteoController extends Controller
public function index()
{
$idCity = 2995971;
$apiKey = env('OPEN_WEATHER_MAP_API_KEY', '');
$apiKey = config('portal.open_weather_map_api_key');
$params = '&units=metric&lang=fr';
$url = 'https://api.openweathermap.org/data/2.5/forecast?id='.$idCity.'&appid='.$apiKey.$params;
$client = new \GuzzleHttp\Client();

5
config/portal.php Normal file
View File

@@ -0,0 +1,5 @@
<?php
return [
'open_weather_map_api_key' => env('OPEN_WEATHER_MAP_API_KEY'),
];