Added Supplier Domain importing - using dreamscape API
This commit is contained in:
40
app/Console/Commands/SupplierDomainSync.php
Normal file
40
app/Console/Commands/SupplierDomainSync.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
use App\Models\{Site,Supplier};
|
||||
use App\Jobs\SupplierDomainSync as Job;
|
||||
|
||||
class SupplierDomainSync extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'supplier:domain:sync'
|
||||
.' {siteid : Site ID}'
|
||||
.' {supplier : Supplier Name}'
|
||||
.' {--f|forceprod : Force Prod API on dev environment}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Sync domains from a supplier';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$so = Supplier::where('name',$this->argument('supplier'))->singleOrFail();
|
||||
|
||||
Job::dispatchSync(Site::findOrFail($this->argument('siteid')),$so,$this->option('forceprod'));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user