Compare contoller, commands for search articles from command line
This commit is contained in:
40
app/Console/Commands/IkeaPrice.php
Normal file
40
app/Console/Commands/IkeaPrice.php
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
38
app/Console/Commands/IkeaPrices.php
Normal file
38
app/Console/Commands/IkeaPrices.php
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user