Compare contoller, commands for search articles from command line

This commit is contained in:
2023-11-27 18:45:38 +01:00
parent eb3ed24204
commit 3e3bcce806
9 changed files with 573 additions and 27 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Http\Controllers\CountryCompareController;
class IkeaPrice extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ikea:price {country} {article}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Get Ikea Prices';
/**
* Execute the console command.
*
* @return int
*/
public function handle(CountryCompareController $countryCompareController)
{
$article = $this->argument('article');
$country = $this->argument('country');
$responses = $countryCompareController->makeRequest($article,$country);
$prices = $countryCompareController->processResponse($responses,$article);
//dd($prices);
return 0;
}
}

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Http\Controllers\CountryCompareController;
class IkeaPrices extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'ikea:prices {article}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Get Ikea Prices';
/**
* Execute the console command.
*
* @return int
*/
public function handle(CountryCompareController $countryCompareController)
{
$article = $this->argument('article');
$responses = $countryCompareController->makeRequests($article);
$prices = $countryCompareController->processResponse($responses,$article);
//dd($prices);
return 0;
}
}