osb/app/Console/Commands/Intuit/InvoiceSync.php

41 lines
759 B
PHP

<?php
namespace App\Console\Commands\Intuit;
use Illuminate\Console\Command;
use Intuit\Traits\ProviderTokenTrait;
use App\Jobs\AccountingInvoiceSync as Job;
class InvoiceSync extends Command
{
use ProviderTokenTrait;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'intuit:invoice:sync'
.' {user? : User Email}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Synchronise invoices with accounting system';
/**
* Execute the console command.
*
* @return int
* @throws \Intuit\Exceptions\NotTokenException
*/
public function handle()
{
Job::dispatchSync($this->providerToken($this->argument('user')));
return self::SUCCESS;
}
}