mirror of
https://github.com/jez500/pricebuddy.git
synced 2026-11-24 19:58:13 +01:00
34 lines
687 B
PHP
34 lines
687 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\PriceFetcherService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class FetchAll extends Command
|
|
{
|
|
const COMMAND = 'buddy:fetch-all';
|
|
|
|
/**
|
|
* The name and signature of the console command.
|
|
*/
|
|
protected $signature = self::COMMAND.' {--log : Log the price fetching}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*/
|
|
protected $description = 'Fetch all prices';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle()
|
|
{
|
|
PriceFetcherService::new()
|
|
->setLogging((bool) $this->option('log'))
|
|
->updateAllPrices();
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|