WIP: feature/handle-currency-exchange #74

Draft
krzysiej wants to merge 3 commits from feature/handle-currency-exchange into master
Showing only changes of commit 09825de7b9 - Show all commits

View File

@@ -27,11 +27,13 @@ class ScrapeWebsite extends Command
public function __construct(protected Capsule $database)
{
parent::__construct();
$this->client = new Client();
$this->getCurrencyExchange();
die();
}
protected function configure(): void
{
$this->client = new Client();
$this->addOption(self::COUNTRY_ID, 'c', InputOption::VALUE_OPTIONAL, 'Country id');
}
@@ -147,4 +149,12 @@ class ScrapeWebsite extends Command
$productModel->stock()->save($stock);
}
}
public function getCurrencyExchange(): void {
$result = $this->client->request('GET', 'https://api.nbp.pl/api/exchangerates/tables/A/?format=json');
dd(json_decode($result->getBody()->getContents()));
}
}