imbangduga add services
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class DailyAkru extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'akru:daily {--zone=1 : Choose which zone to update}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Generate Daily Akrual For Trial Balance';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$zone = $this->option('zone');
|
||||
|
||||
$updateAkruDaily = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/admin/laporan/akrual/generateDaily',[
|
||||
'zone' => $zone
|
||||
])->json();
|
||||
|
||||
if($updateAkruDaily == 'succesful')
|
||||
{
|
||||
return 0;
|
||||
}else{
|
||||
return 'failed';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user