Add command to update transaction in arrahn master table, edit updateUnsuccess command to conform to psr-4

This commit is contained in:
Afiq Hamzah
2024-07-18 14:15:19 +08:00
parent 007921cfe5
commit 25c74ac718
@@ -0,0 +1,50 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Http;
class UpdateTransactionMaster extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'update:transaction-master';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Update arrahn transactions';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$updateOnline = Http::arrahn()->get('/api/transaction/online/update')->json();
if($updateOnline == 'successful'){
return 0;
}else{
Log::error('Update transaction master failed');
}
}
}