<?php

namespace App\Http\Controllers;

use Illuminate\Routing\Controller as BaseController;
use Jason\Api\Traits\ApiResponse;

class Controller extends BaseController
{

    use ApiResponse;

    /**
     * Notes   : 授权token返回格式
     * @Date   : 2021/3/16 5:00 下午
     * @Author : < Jason.C >
     * @param  string  $token
     * @return array
     */
    protected function respondWithToken(string $token): array
    {
        return [
            'access_token' => $token,
            'token_type'   => 'Bearer',
            'expires_in'   => auth('api')->factory()->getTTL() * 60,
        ];
    }

}
