<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Services\SportClientService;

class Leagues extends Command
{
    /**
     * 命令名称和签名
     *
     * @var string
     */
    protected $signature = 'leagues';
    protected $is_live = 0;

    /**
     * 命令描述
     *
     * @var string
     */
    protected $description = '获取所有联赛信息';
    /**
     * 执行命令
     *
     * @return int
     */
    public function handle()
    {
        $data = SportClientService::leagues(['season' => date('Y')]);
        file_put_contents("leagues.json", json_encode($data));
    }

}
