added gold price 5

A1Gard 6 months ago
parent 4c0686ae38
commit b1fdfda4ae

@ -33,20 +33,20 @@ class GoldPriceUpdate extends Command
// //
echo 'start'; echo 'start';
$client = new Client(); // $client = new Client();
$response = $client->request('GET', $this->api); // $response = $client->request('GET', $this->api);
$data = json_decode($response->getBody()->getContents()); // $data = json_decode($response->getBody()->getContents());
print_r($data); // print_r($data);
if (isset($data->gold)) { // if (isset($data->gold)) {
//
$s = Setting::where('key', 'gold')->first(); // $s = Setting::where('key', 'gold')->first();
$s->value = $data->gold; // $s->value = $data->gold;
$s->save(); // $s->save();
$this->info('Price updated successfully'); // $this->info('Price updated successfully');
}else{ // }else{
$this->error('Price update failed'); // $this->error('Price update failed');
} // }
Log::info('updated gold price'); // Log::info('updated gold price');
} }
} }

Loading…
Cancel
Save