40 lines
860 B
PHP
40 lines
860 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
use DB;
|
|
|
|
class UpdateUserRanking extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'user:ranking';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Update User Ranking In every Minute';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return int
|
|
*/
|
|
public function handle()
|
|
{
|
|
$schedule->call(function () {
|
|
$client = new \GuzzleHttp\Client();
|
|
$response = $client->get('http://gsf.betadelivery.com/api/getUserRanking');
|
|
// Handle the API response as needed
|
|
// $statusCode = $response->getStatusCode();
|
|
// ...
|
|
})->everyMinute();
|
|
}
|
|
}
|