diff --git a/app/Console/Commands/updateJbg.php b/app/Console/Commands/updateJbg.php index 4225ef4..14569d3 100644 --- a/app/Console/Commands/updateJbg.php +++ b/app/Console/Commands/updateJbg.php @@ -12,7 +12,7 @@ class updateJbg extends Command * * @var string */ - protected $signature = 'update:jbg'; + protected $signature = 'update:jbg {--all : all zone} {--1 : update zone 1} {--2 : update zone 2} {--3 : update zone3}'; /** * The console command description. @@ -38,13 +38,24 @@ class updateJbg extends Command */ public function handle() { - $updatejbg = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbgsemasa')->json(); + if($this->option('all')){ + $zone = 'all'; + }else if($this->option('1')){ + $zone = '1'; + }else if ($this->option('2')){ + $zone = '2'; + }else if ($this->option('3')){ + $zone = '3'; + } + $updatejbg = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbgsemasa',[ + 'zone' => $zone + ])->json(); $updatejbgLelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/updatejbglelong')->json(); $hapusGadaiNull = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/hapus/gadai/null')->json(); if($updatejbg == 'successful'){ - return 0; + $this->info('Success'); }else{ - return 'failed'; + $this->info('Failed'); } } }