Merge branch 'master' of https://gitlab.com/online-sistem1/kaunter into pipiv2
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class updateJbg extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'update:jbg';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Update JBG for every active gadai';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$updatejbg = Http::get(config('api.url') . '/api/updatejbgsemasa')->json();
|
||||
if($updatejbg == 'successful'){
|
||||
return 0;
|
||||
}else{
|
||||
return 'failed';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected $commands = [
|
||||
Commands\resetRoleDaily::class,
|
||||
Commands\updateJbg::class,
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -24,7 +25,8 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->command('reset:dailyrole')->daily()->timezone('Asia/Kuala_Lumpur')->at('00:00');
|
||||
$schedule->command('reset:dailyrole')->daily()->timezone('Asia/Kuala_Lumpur')->at('00:01');
|
||||
$schedule->command('update:jbg')->daily()->timezone('Asia/Kuala_Lumpur')->at('00:01');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user